-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix(eks): inconsistent fargateProfileName handling causes deletion failure when physicalResourceId exceeds 100 characters #36075
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
base: main
Are you sure you want to change the base?
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.
The pull request linter fails with the following errors:
❌ Fixes must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.
✅ A exemption request has been requested. Please wait for a maintainer's review.
|
Exemption Request Requesting exemption from integration testing requirements for this bug fix:
The unit tests provide sufficient coverage for this straightforward fix. |
…ks-fargate-profile-deletion-long-name
|
Hi @pahud . Need review for this PR. Thanks |
I just clicked CI approval button to trigger the CI run for this PR. After CI passes you should get pr/pending-community-review label and you are all set. Do not click |
|
Sorry, I meant to review your other PR: #35988 |
Issue
Closes #32909.
Reason for this change
When deleting an EKS FargateProfile, the
onDeleteevent directly usesphysicalResourceIdas the profile name without validating its length. IfphysicalResourceIdexceeds 100 characters (AWS EKS's maximum limit), deletion fails with: "The Fargate profile name parameter should not be greater than 100 characters."The
onCreateevent already handles this by generating a valid name when needed, but this logic was missing inonDelete.Description of changes
Updated
onDelete()to use the same name resolution logic asonCreate():fargateProfileNameis explicitly provided in config: use itphysicalResourceIdis valid (≤ 100 chars): use it directlyphysicalResourceIdexceeds 100 chars: generate a name usinggenerateProfileName()Files changed:
fargate.ts: UpdatedonDelete()methodfargate-resource-provider.test.ts: Added 5 unit tests covering all scenariosDescription of how you validated changes
Added comprehensive unit tests:
physicalResourceIdfargateProfileNamehandlingphysicalResourceId> 100 charsAll tests pass:
yarn test fargate-resource-provider.test.tsChecklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license