diff --git a/pkg/apis/eksctl.io/v1alpha5/validation.go b/pkg/apis/eksctl.io/v1alpha5/validation.go index e9be23421a..1eba67c729 100644 --- a/pkg/apis/eksctl.io/v1alpha5/validation.go +++ b/pkg/apis/eksctl.io/v1alpha5/validation.go @@ -666,12 +666,13 @@ func ValidateNodeGroup(i int, ng *NodeGroup) error { return fieldNotSupported("kubeletExtraConfig") } - if ng.AMIFamily == NodeImageFamilyBottlerocket && ng.PreBootstrapCommands != nil { - return fieldNotSupported("preBootstrapCommands") - - } - if ng.OverrideBootstrapCommand != nil { - return fieldNotSupported("overrideBootstrapCommand") + if ng.AMIFamily == NodeImageFamilyBottlerocket { + if ng.PreBootstrapCommands != nil { + return fieldNotSupported("preBootstrapCommands") + } + if ng.OverrideBootstrapCommand != nil { + return fieldNotSupported("overrideBootstrapCommand") + } } } else if err := validateNodeGroupKubeletExtraConfig(ng.KubeletExtraConfig); err != nil { return err diff --git a/pkg/apis/eksctl.io/v1alpha5/validation_test.go b/pkg/apis/eksctl.io/v1alpha5/validation_test.go index 13a582d2d0..3b67d8dbf8 100644 --- a/pkg/apis/eksctl.io/v1alpha5/validation_test.go +++ b/pkg/apis/eksctl.io/v1alpha5/validation_test.go @@ -1698,14 +1698,12 @@ var _ = Describe("ClusterConfig validation", func() { Describe("Windows node groups", func() { It("returns an error with unsupported fields", func() { - cmd := "start /wait msiexec.exe" doc := api.InlineDocument{ "cgroupDriver": "systemd", } ngs := map[string]*api.NodeGroup{ - "OverrideBootstrapCommand": {NodeGroupBase: &api.NodeGroupBase{OverrideBootstrapCommand: &cmd}}, - "KubeletExtraConfig": {KubeletExtraConfig: &doc, NodeGroupBase: &api.NodeGroupBase{}}, + "KubeletExtraConfig": {KubeletExtraConfig: &doc, NodeGroupBase: &api.NodeGroupBase{}}, } for name, ng := range ngs {