Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,9 @@ func ValidateNodeGroup(i int, ng *NodeGroup) error {
if *ng.ContainerRuntime != ContainerRuntimeDockerD && *ng.ContainerRuntime != ContainerRuntimeContainerD && *ng.ContainerRuntime != ContainerRuntimeDockerForWindows {
return fmt.Errorf("only %s, %s and %s are supported for container runtime", ContainerRuntimeContainerD, ContainerRuntimeDockerD, ContainerRuntimeDockerForWindows)
}
if ng.OverrideBootstrapCommand != nil {
return fmt.Errorf("overrideBootstrapCommand overwrites container runtime setting; please use --container-runtime in the bootsrap script instead")
}
}

if ng.MaxInstanceLifetime != nil {
Expand Down
11 changes: 11 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ var _ = Describe("ClusterConfig validation", func() {
err = api.ValidateNodeGroup(0, ng0)
Expect(err).NotTo(HaveOccurred())
})

It("containerd cannot be set together with overrideBootstrapCommand", func() {
cfg := api.NewClusterConfig()
ng0 := cfg.NewNodeGroup()
ng0.Name = "node-group"
ng0.AMIFamily = api.NodeImageFamilyAmazonLinux2
ng0.ContainerRuntime = aws.String(api.ContainerRuntimeContainerD)
ng0.OverrideBootstrapCommand = aws.String("bootstrap command")
err := api.ValidateNodeGroup(0, ng0)
Expect(err).To(MatchError(ContainSubstring("overrideBootstrapCommand overwrites container runtime setting; please use --container-runtime in the bootsrap script instead")))
})
})

Describe("nodeGroups[*].ami validation", func() {
Expand Down