-
Notifications
You must be signed in to change notification settings - Fork 430
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
Don't default RoleAssignmentName on machine templates #2111
Don't default RoleAssignmentName on machine templates #2111
Conversation
Hi @fiunchinho. 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. |
76e0e2f
to
bcfbde4
Compare
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.
/cc @shysank
/ok-to-test |
Ideally, we want to remove |
329b3ed
to
eb9f075
Compare
I gave it a shot, please take a look to see if that's what you meant. |
/lgtm |
@@ -92,5 +104,9 @@ func (r *AzureMachineTemplate) ValidateDelete() error { | |||
|
|||
// Default implements webhookutil.defaulter so a webhook will be registered for the type. | |||
func (r *AzureMachineTemplate) Default() { | |||
r.Spec.Template.Spec.SetDefaults() |
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.
Rather than changing this here, shouldn't we update the func (s *AzureMachineSpec) SetDefaults()
method directly in api/v1beta1/azuremachine_default.go
? That SetDefaults()
method is also invoked in api/v1beta1/azuremachine_webhook.go
(in the func (m *AzureMachine) Default()
method)
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.
I think it makes sense to default the RoleAssignmentName
to a random UUID in the AzureMachine
object, that's fine because all VMs would have a different one. It only doesn't make sense at the AzureMachineTemplate
level.
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 for the explanation, makes sense
So the core issue here seems to be that a static value in a There seems to be something fundamentally broken in the type spec here. What is the ideal way to define machine-specific configuration as distinct from |
eb9f075
to
51b2117
Compare
done |
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.
/lgtm
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon 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 |
/kind bug
What this PR does / why we need it:
While using
SystemAssigned
identity, I can't use more than 1 replica for my control plane. Or more than 1 replica on myMachineDeployments
.The problem is that
AzureMachineTemplate
has aRoleAssignmentName
field for the name of the role assignment, which is then used when creatingAzureMachines
. But if more than oneAzureMachine
or VM is created out of thisAzureMachineTemplate
(i.e having more than 1 VM for the control plane, or even more than 1 replica in aMachineDeployment
) the VM creation will fail with Azure API errorRoleAssignmentUpdateNotPermitted
sayingTenant ID, application ID, principal ID, and scope are not allowed to be updated
.Special notes for your reviewer:
I see that the templates used for e2e tests normally use only 1 replica for tests, that may explain why this hasn't been spotted so far.
TODOs:
Release note: