fix(cfn): preserve path in managed nodegroup instanceRoleARN - #8874
Open
Cozm1n1412 wants to merge 1 commit into
Open
Cozm1n1412 wants to merge 1 commit into
Cozm1n1412 wants to merge 1 commit into
Conversation
Previously, NormalizeARN stripped the path prefix from instanceRoleARN when generating the CloudFormation NodeRole property for managed nodegroups. While originally intended for aws-auth ConfigMap compatibility, this causes managed nodegroups to enter a Degraded state on EKS clusters using Access Entries, as the truncated ARN does not match the actual IAM role. Fixes eksctl-io#7846 Signed-off-by: Cosmin Neculcea <cosminneculcea60@gmail.com>
Contributor
|
Hello Cozm1n1412 👋 Thank you for opening a Pull Request in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #7846
When specifying a pathed IAM role in
managedNodeGroups[*].iam.instanceRoleARN(e.g.arn:aws:iam::123456789012:role/team/custom-node-role),pkg/cfn/builder/managed_nodegroup.gowas invokingNormalizeARN(), stripping the path from the role ARN passed to the CloudFormationAWS::EKS::Nodegroupresource'sNodeRoleproperty.While
NormalizeARNwas historically introduced as a compatibility workaround for theaws-authConfigMap /aws-iam-authenticator(which failed to match pathed ARNs), CloudFormation and the EKS control plane require the exact, canonical IAM role ARN. On EKS 1.29+ clusters utilizing the native Access Entries API, this path truncation causes managed node groups to enter aDegradedstatus with the erroraccess entry not found in cluster.Changes
NormalizeARNcall onm.nodeGroup.IAM.InstanceRoleARNwhen constructing theNodeRoleCloudFormation property inpkg/cfn/builder/managed_nodegroup.go.pkg/cfn/builder/managed_nodegroup_test.go(TestManagedNodeRole) to verify that the instance role ARN retains its full path.Verification
Executed test suite:
All tests pass.