From 92df9a0a34a53c6f7ed351ea48738ee3dc72d0aa Mon Sep 17 00:00:00 2001 From: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> Date: Wed, 6 Apr 2022 09:59:27 +0200 Subject: [PATCH] Removed the restriction of defining overrideBootstrap for Windows images --- pkg/apis/eksctl.io/v1alpha5/validation.go | 13 +++++++------ pkg/apis/eksctl.io/v1alpha5/validation_test.go | 4 +--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pkg/apis/eksctl.io/v1alpha5/validation.go b/pkg/apis/eksctl.io/v1alpha5/validation.go index 050abb92f0..e2c9387f5c 100644 --- a/pkg/apis/eksctl.io/v1alpha5/validation.go +++ b/pkg/apis/eksctl.io/v1alpha5/validation.go @@ -667,12 +667,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 bd986ff1f3..270ce1b4d5 100644 --- a/pkg/apis/eksctl.io/v1alpha5/validation_test.go +++ b/pkg/apis/eksctl.io/v1alpha5/validation_test.go @@ -1674,14 +1674,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 {