fix: fix enforcing up to date ControlPlane's ClusterRole and ClusterRoleBinding #11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
There was an error in the patching logic were the controller would try to patch using a generated resource and this getting:
This PR fixes that both for
ClusterRole
andClusterRoleBinding
.This should fix the flakiness in several of the integration tests that deploy and update
ControlPlane
s (directly or indirectly).Exemplar failure on CI: https://github.com/Kong/gateway-operator-archive/actions/runs/8285193525/job/22672382974?pr=1592#step:4:3602
To reproduce that locally it's enough to edit either of those resources on the cluster. Either change one of the
ClusterRole
's policy rules orClusterRoleBinding
'ssubjects
.The test that's in place
gateway-operator/controllers/controlplane/controlplane_controller_reconciler_utils_test.go
Lines 186 to 187 in 8f01deb