Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed the restriction of defining overrideBootstrap for Windows images #5076

Merged
merged 8 commits into from
Apr 8, 2022
13 changes: 7 additions & 6 deletions pkg/apis/eksctl.io/v1alpha5/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions pkg/apis/eksctl.io/v1alpha5/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down