fix: role patching (#325)

Closes: #318

Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
Leonardo Cecchi 2025-05-08 11:58:31 +02:00 committed by GitHub
parent 9db184f5d4
commit f484b9e748
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -160,7 +160,13 @@ func (r ReconcilerImplementation) ensureRole(
"rules", newRole.Rules,
)
return r.Client.Patch(ctx, newRole, client.MergeFrom(&role))
oldRole := role.DeepCopy()
// Apply to the role the new rules
role.Rules = newRole.Rules
// Push it back to the API server
return r.Client.Patch(ctx, &role, client.MergeFrom(oldRole))
}
func (r ReconcilerImplementation) ensureRoleBinding(