Skip to content

Fix migration watch predicate to fire on status changes#4619

Merged
caseydavenport merged 6 commits intotigera:masterfrom
caseydavenport:casey-migration-watch-predicate
Apr 2, 2026
Merged

Fix migration watch predicate to fire on status changes#4619
caseydavenport merged 6 commits intotigera:masterfrom
caseydavenport:casey-migration-watch-predicate

Conversation

@caseydavenport
Copy link
Copy Markdown
Member

The DatastoreMigration watch in the apiserver controller 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, causing a multi-minute delay before the operator self-restarted in v3 mode.

Replace with a custom watch setup using ResourceVersionChangedPredicate which fires on any resource version change including status updates. Also exports IsResourceReady from utils so the apiserver controller can reuse the CRD readiness check.

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.
@caseydavenport caseydavenport force-pushed the casey-migration-watch-predicate branch from ec44d04 to 866ea00 Compare March 31, 2026 23:56
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 caseydavenport merged commit 4980e9b into tigera:master Apr 2, 2026
6 checks passed
@caseydavenport caseydavenport deleted the casey-migration-watch-predicate branch April 2, 2026 22:22
caseydavenport added a commit to caseydavenport/operator that referenced this pull request Apr 2, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants