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

Add RoleAssignment UUID Generation ADR #3935

Merged
merged 8 commits into from
Jul 14, 2024
Merged

Conversation

super-harsh
Copy link
Collaborator

What this PR does / why we need it:

This PR adds ADR for RoleAssignment UUID clashes. ADR discusses about the issue with UUID clashes for RoleAssignment mentioned in #3637.

If applicable:

  • this PR contains documentation
  • this PR contains tests
  • this PR contains YAML Samples


**Pro**: User does not have to do anything

**Con**: Moving resource with same name between multiple ASO instances would require a workaround
Copy link
Member

Choose a reason for hiding this comment

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

Including subid in the seed doesn't imply this, does it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

True, will update.
The case is more when Moving resource with same name between older to newer ASO version would require a workaround

super-harsh and others added 3 commits April 18, 2024 12:12
…ation.md

Co-authored-by: Matthew Christopher <matthchr@users.noreply.github.com>
…ation.md

Co-authored-by: Matthew Christopher <matthchr@users.noreply.github.com>

To use deterministic uuid(default)
```yaml
serviceoperator.azure.com/uuid-generation: Default
Copy link
Member

Choose a reason for hiding this comment

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

I don't love Default as a value because it doesn't actually say what the default is. IMO we should call this something like Stable

Copy link
Member

Choose a reason for hiding this comment

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

This applies to the above option 1 as well.

To use deterministic uuid(default)
```yaml
serviceoperator.azure.com/uuid-generation: Default
```
Copy link
Member

Choose a reason for hiding this comment

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

I think you should talk here about how we actually do defaulting too:

There are two options:

  • If not specified, automatically set serviceoperator.azure.com/uuid-generation: Default when a resource is created when defaulting its name.
  • If not specified, don't set any annotation (but still generate a UUID as per the Default pattern.

I think it's OK to default-in the uuid-generation annotation if the user hasn't set it (and also hasn't set the name?). I guess if the name is set by the user, then we wouldn't add the annotation at all because we actualyl didn't do any generation?

and if the user sets it, we'll honor what they set (though it'll not do anything if they set it and the name)?

@matthchr
Copy link
Member

Approved but had a few comments

@theunrepentantgeek theunrepentantgeek modified the milestones: v2.7.0, v2.8.0 Apr 29, 2024
- include the group and kind to ensure that different kinds of resources get different UUIDs. This isn't entirely required by Azure, but it makes sense to avoid collisions between two resources of different types even if they have the same namespace and name.
- include the owner group, kind, and name to avoid collisions between resources with the same name in different clusters that actually point to different Azure resources.

However, the case where users have multiple ASO instances in multiple clusters with resources in the same namespace, in each cluster having the same name and pointing to different Azure resource is not supported without the user manually giving each RoleAssignment its own UUID.
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this sentence.


**Pro**: User does not have to do anything

**Con**: Moving resource with same name between older to newer ASO version would require a workaround
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change when someone upgrades the version of ASO in their cluster, as any automated deployments will suddenly experience different behaviour.

Comment on lines 69 to 71
Recommendation: Option 2 - Using annotations

We retain how the resource shape looks like and suggest using annotation for the users running into the edge case.
Copy link
Member

Choose a reason for hiding this comment

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

Ergh. Do not like.

super-harsh and others added 2 commits May 14, 2024 10:53
…ation.md

Co-authored-by: Bevan Arps <bevan.arps@microsoft.com>
…ation.md

Co-authored-by: Bevan Arps <bevan.arps@microsoft.com>
@matthchr matthchr modified the milestones: v2.8.0, v2.9.0 Jun 25, 2024
@super-harsh super-harsh added this pull request to the merge queue Jul 14, 2024
Merged via the queue into main with commit a664405 Jul 14, 2024
8 checks passed
@super-harsh super-harsh deleted the design/roleassignment-uuid branch July 14, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants