-
Notifications
You must be signed in to change notification settings - Fork 578
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
fix: don't generate nodegroup role name starting with hyphen #4463
fix: don't generate nodegroup role name starting with hyphen #4463
Conversation
Signed-off-by: David van der Spek <[email protected]>
Welcome @davidspek! |
Hi @davidspek. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
@richardcase Have you had the chance to take a look at this PR? |
/test pull-cluster-api-provider-aws-e2e-eks |
/lgtm cc @richardcase for approval |
This will definitely cause existing clusters to break right? Since it will look for a specific role format? |
@Skarlso that's a good point, shall we hold it for next release? |
Yep, sounds good. |
I'm not sure if it would break existing clusters, since this code is only used to create a new role if none were specified in the node group, which then get placed into the node group CR. Existing node group CRs would have the name of the role already in them. |
It sets up the role name and then looks for it: s.scope.ManagedMachinePool.Spec.RoleName = roleName
}
role, err := s.GetIAMRole(s.scope.RoleName()) When reconciling normally, this would also happen and since it wouldn't find it, because it's looking for the set name it would try creating one again. |
Ah but it only does that if the role is empty. Which would only happen if the role hasn't been created yet. |
Okay, thinking about this some more, it should be fine. It should only happen for new clusters and old clusters should work. UNLESS, for whatever reason, the role name is wiped and it needs to look for it again. |
Is there even logic to handle having the role name being wiped properly? The field should be immutable and if it gets removed I don't think there's a way to be able to recover what it should be (since it could also be a non-generated name). |
cc @richardcase for final approval |
/cherry-pick release-2.2 |
@Ankitasw: once the present PR merges, I will cherry-pick it on top of release-2.2 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@AndiDog Maybe you can have a look at this as well. |
I'll take a look later today. Been busy with work. |
Awesome, thanks! |
Okay, we did run tests, I thought this through, and I think it shouldn't break anything. "Famous last words". Here we go: |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Skarlso The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@Ankitasw: new pull request created: #4516 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Currently if
EnableIAM
is set to true and no role is specified for a node group the controller auto generates a role. However, the name formatting seems to be backwards from what it is intended to be, causing the role name to start with a-
. What's surprising to me is that this doesn't seem to cause problems, other than that it looks weird. The name for the role that is currently generated looks like:-nodegroup-iam-service-role_<cluster-name>-<nodegroup-name>
. This PR swaps the generated role name so it will be:<cluster-name>-<nodegroup-name>_nodegroup-iam-service-role
. This is follows the same format as the name generated for Fargate.Special notes for your reviewer:
Checklist:
Release note: