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 {
3838 return err
3939 }
4040
41+ if restored .Spec .NodeType != "" {
42+ dst .Spec .NodeType = restored .Spec .NodeType
43+ }
4144 if restored .Spec .PreBootstrapCommands != nil {
4245 dst .Spec .PreBootstrapCommands = restored .Spec .PreBootstrapCommands
4346 }
@@ -105,6 +108,9 @@ func (r *EKSConfigTemplate) ConvertTo(dstRaw conversion.Hub) error {
105108 return err
106109 }
107110
111+ if restored .Spec .Template .Spec .NodeType != "" {
112+ dst .Spec .Template .Spec .NodeType = restored .Spec .Template .Spec .NodeType
113+ }
108114 if restored .Spec .Template .Spec .PreBootstrapCommands != nil {
109115 dst .Spec .Template .Spec .PreBootstrapCommands = restored .Spec .Template .Spec .PreBootstrapCommands
110116 }
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ package userdata
1919import (
2020 "bytes"
2121 "fmt"
22+ "strings"
2223 "text/template"
2324
2425 "github.com/alessio/shellescape"
9192{{- end -}}`
9293
9394 al2023DockerConfigTemplate = `{{- define "al2023DockerConfig" -}}
94- {{- if . -}}
95+ {{- if and . (ne . "''") -}}
9596 dockerConfig: {{.}}
9697{{- end -}}
9798{{- end -}}`
@@ -330,7 +331,14 @@ func generateAL2023UserData(input *NodeInput) ([]byte, error) {
330331 // Get capacity type as string
331332 capacityType := "ON_DEMAND" // Default value
332333 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+ }
334342 }
335343
336344 // Get AMI ID - use empty string if not specified
You can’t perform that action at this time.
0 commit comments