Skip to content

Commit

Permalink
Removed the restriction of defining overrideBootstrap for Windows ima…
Browse files Browse the repository at this point in the history
…ges (#5076)
  • Loading branch information
Skarlso authored Apr 8, 2022
1 parent c90958b commit 369a261
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
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 @@ -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
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 @@ -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 {
Expand Down

0 comments on commit 369a261

Please sign in to comment.