Skip to content
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

Cilium CLI: Trim EKS cluster ARN to extract valid cluster name #36952

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

jaehanbyun
Copy link
Contributor

@jaehanbyun jaehanbyun commented Jan 12, 2025

Please ensure your pull request adheres to the following guidelines:

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • If your commit description contains a Fixes: <commit-id> tag, then
    please add the commit author[s] as reviewer[s] to this issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Are you a user of Cilium? Please add yourself to the Users doc
  • Thanks for contributing!

This pull request resolves the issue of interpreting the EKS Cluster ARN in the comments in issue #34006. It introduces the trimEKSClusterARN function to extract the actual cluster name, ensures the cluster name does not exceed 32 characters. This prevents validation errors during installation.

Before

 jaehan 🚀  ~
 cilium install --version 1.16.5 
🔮 Auto-detected Kubernetes kind: EKS
ℹ️  Using Cilium version 1.16.5
🔮 Auto-detected cluster name: arn:aws:eks:ap-northeast-2:730904690368:cluster/test-cluster
🔮 Auto-detected kube-proxy has been installed
🔥 Patching the "aws-node" DaemonSet to evict its pods...

Error: Unable to install Cilium: execution error at (cilium/templates/validate.yaml:144:5): The cluster name is invalid: must not be more than 32 characters. Configure 'upgradeCompatibility' to 1.15 or earlier to temporarily skip this check at your own risk

After

jaehan 🚀  ~/projects/cilium/cilium-cli/release   main ±
 cilium install --version 1.16.5 
🔮 Auto-detected Kubernetes kind: EKS
ℹ️  Using Cilium version 1.16.5
🔮 Auto-detected cluster name: test-cluster
🔮 Auto-detected kube-proxy has been installed
🔥 Patching the "aws-node" DaemonSet to evict its pods...

@jaehanbyun jaehanbyun requested review from a team as code owners January 12, 2025 10:32
@jaehanbyun jaehanbyun requested review from asauber and Artyop January 12, 2025 10:32
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jan 12, 2025
@github-actions github-actions bot added cilium-cli This PR contains changes related with cilium-cli cilium-cli-exclusive This PR only impacts cilium-cli binary kind/community-contribution This was a contribution made by a community member. labels Jan 12, 2025
@jaehanbyun jaehanbyun force-pushed the handle-eks-cluster-arn branch 3 times, most recently from 2351247 to 9bb82f8 Compare January 12, 2025 10:38
Copy link
Contributor

@Artyop Artyop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jaehanbyun and thank your for your pull request !
Can you please add a commit description to your commit message? Please refer to requirement 5 of Submitting a pull request

cilium-cli/install/autodetect.go Show resolved Hide resolved
@jaehanbyun jaehanbyun force-pushed the handle-eks-cluster-arn branch from 9bb82f8 to 7851fe0 Compare January 13, 2025 11:50
@Artyop Artyop self-requested a review January 13, 2025 14:17
@Artyop
Copy link
Contributor

Artyop commented Jan 13, 2025

/test

@jaehanbyun
Copy link
Contributor Author

@Artyop

Please feel free to let me know if there are any other tasks I need to perform!

Copy link
Contributor

@Artyop Artyop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, still needs approval of CLI team

@jaehanbyun jaehanbyun changed the title Trim EKS cluster ARN to extract valid cluster name Cilium CLI: Trim EKS cluster ARN to extract valid cluster name Jan 15, 2025
cilium-cli/install/autodetect.go Show resolved Hide resolved
cilium-cli/install/autodetect.go Outdated Show resolved Hide resolved
@tklauser tklauser added the release-note/misc This PR makes changes that have no direct user impact. label Jan 15, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jan 15, 2025
- Introduces the `trimEKSClusterARN` function to extract the actual cluster name from the ARN.
- Ensures the extracted cluster name does not exceed 32 characters, preventing validation errors during installation.
- Updates the Cilium CLI to handle only the trailing part of the EKS cluster name, removing invalid characters such as colons (:).

Signed-off-by: jaehanbyun <awbrg789@naver.com>
@jaehanbyun jaehanbyun force-pushed the handle-eks-cluster-arn branch from 7851fe0 to 96e13e3 Compare January 15, 2025 13:46
@tklauser
Copy link
Member

/test

@tklauser tklauser enabled auto-merge January 15, 2025 15:30
@tklauser
Copy link
Member

tklauser commented Jan 16, 2025

/test

Image builds failed due to infra issues in previous run, re-triggered.

@giorio94
Copy link
Member

/test

1 similar comment
@jaehanbyun
Copy link
Contributor Author

/test

@tklauser tklauser added this pull request to the merge queue Jan 16, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jan 16, 2025
Merged via the queue into cilium:main with commit 8f8f42f Jan 16, 2025
62 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cilium-cli This PR contains changes related with cilium-cli cilium-cli-exclusive This PR only impacts cilium-cli binary kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants