Skip to content

Commit

Permalink
add validation error for maxpods limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
TiberiuGC committed Apr 3, 2024
1 parent f5932a0 commit de74c5b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,10 @@ func ValidateManagedNodeGroup(index int, ng *ManagedNodeGroup) error {
}
}

if ng.AMIFamily == NodeImageFamilyAmazonLinux2023 && ng.MaxPodsPerNode > 0 {
return errors.Errorf("eksctl does not support configuring maxPodsPerNode EKS-managed nodes based on %s", NodeImageFamilyAmazonLinux2023)
}

if ng.AMIFamily == NodeImageFamilyBottlerocket {
fieldNotSupported := func(field string) error {
return &unsupportedFieldError{
Expand Down
10 changes: 10 additions & 0 deletions pkg/apis/eksctl.io/v1alpha5/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2092,6 +2092,16 @@ var _ = Describe("ClusterConfig validation", func() {
})
})

Describe("AmazonLinux2023 node groups", func() {
It("returns an error when setting maxPodsPerNode for managed nodegroups", func() {
ng := api.NewManagedNodeGroup()
ng.AMIFamily = api.NodeImageFamilyAmazonLinux2023
ng.MaxPodsPerNode = 5
err := api.ValidateManagedNodeGroup(0, ng)
Expect(err).To(MatchError(ContainSubstring("eksctl does not support configuring maxPodsPerNode EKS-managed nodes")))
})
})

Describe("Windows node groups", func() {
It("returns an error with unsupported fields", func() {
doc := api.InlineDocument{
Expand Down

0 comments on commit de74c5b

Please # to comment.