bug: RemoteURL polling interval blocks drift-detection reconciliation - #1929
Merged
Merged
Conversation
When a PolicyRef or KustomizationRef uses `RemoteURL` with an `Interval`, a successful
reconcile schedules a periodic re-fetch by both returning
`reconcile.Result{RequeueAfter: interval}` and setting NextReconcileTime in the
ClusterSummary Status.
The latter suppresses *every* reconcile of that ClusterSummary until the cooldown
expires.
A drift-detection-triggered reconcile only resets FeatureSummary status and that reconciliation
is skipped till we are past NextReconcileTime.
So with `SyncMode: ContinuousWithDriftDetection` and a RemoteURL interval of 10 minutes for
instance, a configuration drift would not be recovered till we are past NextReconcileTime.
The `setNextReconcileTime` call was incorrect. When RemoteURL is used, only a new reconciliation
needs to be scheduled (to check whether the content of the remote URL has changed).
This PR fixes this issue by not setting the NextReconcileTime in this specific scenario.
test/fv/remote_url_test.go now uses `ContinuousWithDriftDetection` and deletes a deployed
resource mid-test to verify Sveltos redeploys it promptly, rather than only exercising
`Continuous` sync mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When a PolicyRef or KustomizationRef uses
RemoteURLwith anInterval, a successful reconcile schedules a periodic re-fetch by both returningreconcile.Result{RequeueAfter: interval}and setting NextReconcileTime in the ClusterSummary Status.The latter suppresses every reconcile of that ClusterSummary until the cooldown expires.
A drift-detection-triggered reconcile only resets FeatureSummary status and that reconciliation is skipped till we are past NextReconcileTime.
So with
SyncMode: ContinuousWithDriftDetectionand a RemoteURL interval of 10 minutes for instance, a configuration drift would not be recovered till we are past NextReconcileTime.The
setNextReconcileTimecall was incorrect. When RemoteURL is used, only a new reconciliation needs to be scheduled (to check whether the content of the remote URL has changed).This PR fixes this issue by not setting the NextReconcileTime in this specific scenario.
test/fv/remote_url_test.go now uses
ContinuousWithDriftDetectionand deletes a deployed resource mid-test to verify Sveltos redeploys it promptly, rather than only exercisingContinuoussync mode.Fixes 1928