-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix(installer): trim EKS cluster name from both ARN and eksctl formats #39500
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
Conversation
Looks reasonable! Just a few small requests, nothing exciting. Thanks for the PR! (feel free to re-request review, otherwise it gets lost in the noise.) |
Thanks for the review! 🙏 I'll update the prefix to |
I've updated the prefix and added the docblock as suggested. Re-requesting review now 🙇♂️ |
Looks good. Image build failure looks like a blip, I'm re-triggering everything. |
/test |
Looking at the CI results, this will need a rebase (to pick up some multi-pool IPAM changes that are tested by the workflow). Will do so now ... |
3b56978
to
832687d
Compare
/test |
The unit test you added is failing:
|
Hi, I noticed a test case failed after changing the prefix from The failed test case uses Given this, I’m considering a few possible directions:
I’d really appreciate your thoughts on which direction would be best here. 🙂
|
@zzuckerfrei let's update the test case to reflect a real cluster naming convention :-). But great question. |
Head branch was pushed to by a user without write access
Hi, sorry about the noise earlier — I mistakenly pushed a broken rebase that included a huge number of unrelated changes and reviewers. Thanks a lot for cleaning up the reviewers list and for your patience! |
/test |
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.
@zzuckerfrei could you please squash the three commits into a single one? Other than that LGTM.
Head branch was pushed to by a user without write access
1f773bf
to
fd448eb
Compare
/test |
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!
Rebased to pull in fixes for the CI failures. |
Clusters created with eksctl often use a context name like <cluster-name>.<region>.eksctl.io, which previously wasn't correctly trimmed during auto-detection. This could cause validation errors such as 'cluster name must not be more than 32 characters'. This commit introduces a new helper function trimEKSClusterName() to correctly handle: - ARN format: arn:aws:eks:<region>:<account>:cluster/<name> - eksctl FQDN format: <name>.<region>.eksctl.io Also includes unit tests to validate this logic: - Removed unrealistic cluster/my-cluster input - Added examples using ARN-style names and eksctl FQDNs - Maintains edge case coverage for invalid and empty inputs Signed-off-by: zzuckerfrei <seonmin1219@gmail.com>
fd448eb
to
e6f5f2c
Compare
/test |
1 similar comment
/test |
Hi, @tklauser, Thank you so much for the rebase and all your help with this PR! 🙏 I noticed there are still some CI failures. Is there anything I can do on my end to help resolve them, or should I wait for the infrastructure issues to be resolved? Really appreciate your time and patience! |
The failures look unrelated to this change and are likely flaky tests. I've re-triggered the failing workflows. |
Clusters created with
eksctl
often use a kube-context like<cluster-name>.<region>.eksctl.io
,which was previously not correctly trimmed during auto-detection.
This led to validation errors such as:
cluster name must not be more than 32 characters
.This commit introduces
trimEKSClusterName()
to correctly handle both:ARN format:
arn:aws:eks:<region>:<account>:cluster/<name>
eksctl FQDN format:
<name>.<region>.eksctl.io
Changes include:
Applying trimming logic in
autodetectAndValidate()
before replacing disallowed characters (_
,.
,:
)Adding unit tests for edge cases across both formats
This ensures consistent and robust cluster name parsing across different EKS setups.
Fixes: #39482