Fix migration watch predicate to fire on status changes#4619
Merged
caseydavenport merged 6 commits intotigera:masterfrom Apr 2, 2026
Merged
Fix migration watch predicate to fire on status changes#4619caseydavenport merged 6 commits intotigera:masterfrom
caseydavenport merged 6 commits intotigera:masterfrom
Conversation
The DatastoreMigration watch in the apiserver and installation controllers used WaitToAddResourceWatch, whose default predicate only fires when metadata.generation changes. Migration phase transitions are status-only updates that don't bump generation, so the watch never triggered a reconcile — the controller only noticed the Converged phase on a periodic or unrelated reconcile. Add WaitToAddMigrationWatch utility that uses ResourceVersionChangedPredicate, which fires on any resource version change including status updates. Update both controllers to use it.
ec44d04 to
866ea00
Compare
rene-dekker
reviewed
Apr 2, 2026
rene-dekker
approved these changes
Apr 2, 2026
Address review feedback: instead of a migration-specific watch function that duplicates the polling/backoff loop, add variadic predicate support to WaitToAddResourceWatch. Callers can now pass custom predicates (e.g., ResourceVersionChangedPredicate for status-only updates) while the default generation-based predicate is used when none are provided. This removes the datastoremigration import from utils.go and keeps the migration-specific knowledge in the controllers that need it.
caseydavenport
added a commit
to caseydavenport/operator
that referenced
this pull request
Apr 2, 2026
5 tasks
caseydavenport
added a commit
that referenced
this pull request
Apr 2, 2026
* Fix migration watch predicate to fire on status changes (#4619) * Fix istio ImageSet test names for release branch The tests hardcoded "calico-master" and "enterprise-master" as ImageSet names, but on the release branch the expected names use the actual release version (e.g., calico-release-v3.32). Use components.CalicoRelease and components.EnterpriseRelease so the names are always correct.
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.
The DatastoreMigration watch in the apiserver controller used
WaitToAddResourceWatch, whose default predicate only fires whenmetadata.generationchanges. Migration phase transitions are status-only updates that don't bump generation, so the watch never triggered a reconcile — the controller only noticed theConvergedphase on a periodic or unrelated reconcile, causing a multi-minute delay before the operator self-restarted in v3 mode.Replace with a custom watch setup using
ResourceVersionChangedPredicatewhich fires on any resource version change including status updates. Also exportsIsResourceReadyfrom utils so the apiserver controller can reuse the CRD readiness check.