Azure / azure-service-operator

Azure Service Operator allows you to create Azure resources using kubectl
https://azure.github.io/azure-service-operator/
MIT License
702 stars 188 forks source link

Bug: RoleAssignment and SqlRoleAssignment don't consider the ARMID of their owner when generating a unique ID #4079

Open matthchr opened 3 weeks ago

matthchr commented 3 weeks ago

Version of Azure Service Operator ASOv2

Describe the bug The RoleAssignment and SqlRoleAssignment resources don't account for the fact that their owner can be an ARM ID (empty group + kind + name). When the owner is from an ARM ID, they don't include that in their unique UUID generation, which means that two different clusters with RoleAssignments with the same namespace/name but different ARMID owners will have the same UUID generated and collide.

Expected behavior The owner is considered in UUID generation.

Additional context Fixing this may be breaking, though we can consider using #3935 to allow users to opt-back into the old behavior if we wanted.

matthchr commented 3 weeks ago

There's also a (less critical) bug around group/kind ordering in the uniqueness string we could fix as part of this... not sure if it's worth it though as it will likely impact more users.