Skip reconciliation when using sailoperator.io/ignore annotation#1256
Conversation
Signed-off-by: bmangoen <bmangoen@redhat.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1256 +/- ##
==========================================
- Coverage 77.78% 77.48% -0.31%
==========================================
Files 44 44
Lines 2823 2834 +11
==========================================
Hits 2196 2196
- Misses 521 529 +8
- Partials 106 109 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: bmangoen <bmangoen@redhat.com>
|
Could you add a step to one of the integration tests, making a change to an object with the annotation and making sure that the controller does not reconcile it? |
dgn
left a comment
There was a problem hiding this comment.
lgtm so far, but an integration test would be good
|
Thanks for taking the request into action! Just wanted to clarify that initial request was related only to the operator managed resources, e.g. only Istio / IstioRevision / IstioRevisionTag / IstioCNI / ZTunnel should be the target for the annotation. |
This commit adds the step to test the skip reconciliation when the sailoperator.io/ignore annotation is set to true on a resource. Signed-off-by: bmangoen <bmangoen@redhat.com>
Interesting. What's your use case for that? The issue you linked as an example was caused by Azure making changes to a WebhookConfiguration, which resulted in the Sail Operator reverting those changes. Annotating the WebhookConfiguration would help in this case. Why would you want to pause reconciliation of an operator-owned resource? |
|
Correct. Until there's a solution to ignore specific fields on child resources, I’d prefer to pause the reconciliation of selected operator-owned resources. |
This commit adds more unit tests cases for IgnoreUpdateWhenAnnotation predicate. Signed-off-by: bmangoen <bmangoen@redhat.com>
Understood - I don't think that's something we'll implement though, as it just hides bugs in the operator. If the operator is continuously reconciling a resource, there's something wrong (usually another controller is acting on the same resources) and I'd prefer us to work on that root cause (ignoring the other controller's change, for example) than just pausing the reconciliation of a control plane component. I do see where you're coming from though. You can try adding With respect to the helm revision increasing, that's actually a known issue (#429) but it doesn't necessarily mean that the operator is applying any changes to the cluster. It's just that helm increases the revision count, even if you just rollback to a specific revision (to make sure all resources are in the expected state) |
| } | ||
| Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(webhook), webhook)).To(Succeed()) | ||
|
|
||
| GinkgoWriter.Println("webhook:", webhook) |
|
In response to a cherrypick label: new pull request created: #1276 |
…io-ecosystem#1256) * Skip reconciliation when using sailoperator.io/ignore annotation Signed-off-by: bmangoen <bmangoen@redhat.com> * Watch all resources with IgnoreUpdateWhenAnnotation predicate Signed-off-by: bmangoen <bmangoen@redhat.com> * fix: add integration tests This commit adds the step to test the skip reconciliation when the sailoperator.io/ignore annotation is set to true on a resource. Signed-off-by: bmangoen <bmangoen@redhat.com> * Add more steps for unit tests This commit adds more unit tests cases for IgnoreUpdateWhenAnnotation predicate. Signed-off-by: bmangoen <bmangoen@redhat.com> --------- Signed-off-by: bmangoen <bmangoen@redhat.com> Signed-off-by: Daniel Grimm <dgrimm@redhat.com>
What type of PR is this?
What this PR does / why we need it:
With this fix, setting
sailoperator.io/ignore: "true"on a resource will skip its reconciliation.This is a temporary hack until we implement the Manifest Customization feature
Which issue(s) this PR fixes:
Fixes #1242
Additional information: