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 support for RoleDefinition resource #4067

Merged
merged 5 commits into from
Jun 12, 2024

Conversation

matthchr
Copy link
Member

@matthchr matthchr commented Jun 7, 2024

This fixes #2570.

Closes #[issue number]

What this PR does / why we need it:

Special notes for your reviewer:

How does this PR make you feel:
gif

If applicable:

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

// TODO: Fix name
// MakeUniqueResourceString generates a string that uniquely identifies a cluster resource.
func MakeUniqueResourceString2(ownerGK schema.GroupKind, ownerName string, gk schema.GroupKind, namespace string, name string) string {
// TODO: This method has a bug where it is called with an empty owner gk when the owner is an ARM ID.
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100% sure what we should do about this bug. We can fix it (which could cause people to leak resources? Maybe not because our validation will protect us possibly? I need to do some testing...)

Copy link
Member Author

Choose a reason for hiding this comment

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

I filed #4079 to track this in 2.9.0 and fixed this bug but only for the new resource RoleDefinition. We can track fixing it for existing resources as part of 2.9.0 with the above bug.

@matthchr
Copy link
Member Author

/ok-to-test sha=197c54d

@matthchr
Copy link
Member Author

/ok-to-test sha=e6ace07

 * Re-record tests using the newer API version.
Split Taskfile targets more to make it easier to run manual upgrade
tests where the flow is:

 1. Install GA ASO.
 2. Perform manual testing step.
 3. Upgrade to vNext ASO.
 4. Perform manual testing step.
@matthchr
Copy link
Member Author

/ok-to-test sha=3af4937

@matthchr
Copy link
Member Author

/ok-to-test sha=22738a3

Fix bug where RoleAssignment owned by ARM ID doesn't account for the
ARM ID in the seed of the random UUID generate.

This bugfix is BREAKING if the owner is using ARM ID and in the
following cases:
 * User migrates RoleAssignment from one cluster to another.
 * User sets reconcile-policy: skip, deletes the RoleAssignment and then
   recreates it.

In the above two cases, the new correct algorithm will consider the ARM
ID of the owner and generate a different UUID than before. Other cases
such as standard updates will not be impacted as Kubernetes sends the
WHOLE object to the mutating webhook and for updates the object contains
the (old) generated UUID.
@matthchr
Copy link
Member Author

/ok-to-test sha=197c54d

@matthchr
Copy link
Member Author

/ok-to-test sha=76e168b

@matthchr matthchr added the new-resource Requests for new supported resources label Jun 11, 2024
@matthchr matthchr added this pull request to the merge queue Jun 12, 2024
@matthchr matthchr removed this pull request from the merge queue due to a manual request Jun 12, 2024
@matthchr matthchr added this pull request to the merge queue Jun 12, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jun 12, 2024
@matthchr matthchr added this pull request to the merge queue Jun 12, 2024
Merged via the queue into Azure:main with commit 3effce6 Jun 12, 2024
8 checks passed
@matthchr matthchr deleted the feature/role-defs branch June 12, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-resource Requests for new supported resources
Projects
Development

Successfully merging this pull request may close these issues.

Feature: Create RoleDefinitions
2 participants