-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not wait for aws-ebs-csi-driver if there are no nodegroups #5929
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello radTuti 馃憢 Thank you for opening a Pull Request in eksctl
project. The team will review the Pull Request and aim to respond within 1-10 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl
on our website
db73b4f
to
6d86abd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed PR. I have left some suggestions on improving the tests but otherwise it LGTM!
pkg/actions/addon/addon.go
Outdated
var ( | ||
ExportWaitForAddonToBeActive = (*Manager).waitForAddonToBeActive | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want this exposed outside of this package, especially since there's an alternative. You could test this case by calling manager.Create
, passing a non-zero waitTimeout
. You'll have to mock the Addons API though. There are examples in pkg/actions/addon/create_test.go
.
var ( | |
ExportWaitForAddonToBeActive = (*Manager).waitForAddonToBeActive | |
) |
pkg/actions/addon/addon_test.go
Outdated
var ( | ||
clusterConfig *api.ClusterConfig | ||
mockProvider *mockprovider.MockProvider | ||
manager *addon.Manager | ||
) | ||
|
||
BeforeEach(func() { | ||
var err error | ||
clusterConfig = &api.ClusterConfig{Metadata: &api.ClusterMeta{ | ||
Version: "1.18", | ||
Name: "my-cluster", | ||
}} | ||
mockProvider = mockprovider.NewMockProvider() | ||
manager, err = addon.New(clusterConfig, mockProvider.EKS(), nil, false, nil, nil) | ||
Expect(err).NotTo(HaveOccurred()) | ||
}) | ||
|
||
When("addon is coredns with no nodegroup", func() { | ||
It("does not wait for addon to be active", func() { | ||
a := &api.Addon{ | ||
Name: api.CoreDNSAddon, | ||
} | ||
err := addon.ExportWaitForAddonToBeActive(manager, context.Background(), a, 0) | ||
Expect(err).To(BeNil()) | ||
}) | ||
}) | ||
|
||
When("addon is aws-ebs-csi-driver with no nodegroup", func() { | ||
It("does not wait for addon to be active", func() { | ||
a := &api.Addon{ | ||
Name: api.AWSEBSCSIDriverAddon, | ||
} | ||
err := addon.ExportWaitForAddonToBeActive(manager, context.Background(), a, 0) | ||
Expect(err).To(BeNil()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go in pkg/actions/addon/create_test.go
and, as noted in the comment above, it should be tested by calling manager.Create
.
vpcCNIName = "vpc-cni" | ||
ebsCSIDriverName = "aws-ebs-csi-driver" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃憤
e092b8c
to
c2b4e08
Compare
Thanks for the review and updating the tests. I have updated the branch. Is there anything else needed to get this merged? |
c2b4e08
to
708c544
Compare
Description
similar to #5458; closes #5891, #5585
aws-ebs-csi-driver will stay in degraded state until nodegroups are added.
SInce the addon is now a requirement for k8s 1.23, the cluster creation should not fail.
Manual validation
Given cluster config
cluster.yaml
Running
eksctl create cluster -f cluster.yaml --without-nodegroup
successfully creates the cluster with no node group.Additional validated scenarios:
desiredCapacity: 0
incluster.yaml
and runningeksctl create cluster -f cluster.yaml
desiredCapacity:0
,maxSize: 3
incluster.yaml
and runningeksctl create cluster -f cluster.yaml
Checklist
Added/modified documentation as required (such as theREADME.md
, or theuserdocs
directory)area/nodegroup
) and kind (e.g.kind/improvement
)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 馃く