File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,9 @@ func (r *EKSConfig) ConvertTo(dstRaw conversion.Hub) error {
38
38
return err
39
39
}
40
40
41
+ if restored .Spec .NodeType != "" {
42
+ dst .Spec .NodeType = restored .Spec .NodeType
43
+ }
41
44
if restored .Spec .PreBootstrapCommands != nil {
42
45
dst .Spec .PreBootstrapCommands = restored .Spec .PreBootstrapCommands
43
46
}
@@ -105,6 +108,9 @@ func (r *EKSConfigTemplate) ConvertTo(dstRaw conversion.Hub) error {
105
108
return err
106
109
}
107
110
111
+ if restored .Spec .Template .Spec .NodeType != "" {
112
+ dst .Spec .Template .Spec .NodeType = restored .Spec .Template .Spec .NodeType
113
+ }
108
114
if restored .Spec .Template .Spec .PreBootstrapCommands != nil {
109
115
dst .Spec .Template .Spec .PreBootstrapCommands = restored .Spec .Template .Spec .PreBootstrapCommands
110
116
}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package userdata
19
19
import (
20
20
"bytes"
21
21
"fmt"
22
+ "strings"
22
23
"text/template"
23
24
24
25
"github.com/alessio/shellescape"
91
92
{{- end -}}`
92
93
93
94
al2023DockerConfigTemplate = `{{- define "al2023DockerConfig" -}}
94
- {{- if . -}}
95
+ {{- if and . (ne . "''") -}}
95
96
dockerConfig: {{.}}
96
97
{{- end -}}
97
98
{{- end -}}`
@@ -330,7 +331,14 @@ func generateAL2023UserData(input *NodeInput) ([]byte, error) {
330
331
// Get capacity type as string
331
332
capacityType := "ON_DEMAND" // Default value
332
333
if input .CapacityType != nil {
333
- capacityType = string (* input .CapacityType )
334
+ switch * input .CapacityType {
335
+ case v1beta2 .ManagedMachinePoolCapacityTypeSpot :
336
+ capacityType = "SPOT"
337
+ case v1beta2 .ManagedMachinePoolCapacityTypeOnDemand :
338
+ capacityType = "ON_DEMAND"
339
+ default :
340
+ capacityType = strings .ToUpper (string (* input .CapacityType ))
341
+ }
334
342
}
335
343
336
344
// Get AMI ID - use empty string if not specified
You can’t perform that action at this time.
0 commit comments