Skip to content

fix(controller): watch Connection to clear stale TemporalConnection status - #545

Open
htonkovac wants to merge 1 commit into
temporalio:mainfrom
htonkovac:fix/watch-connection-in-deprecated-tc-reconciler
Open

fix(controller): watch Connection to clear stale TemporalConnection status#545
htonkovac wants to merge 1 commit into
temporalio:mainfrom
htonkovac:fix/watch-connection-in-deprecated-tc-reconciler

Conversation

@htonkovac

Copy link
Copy Markdown

While migrating our clusters across the 0.26.0 CRD rename, our deprecated
TemporalConnection objects got stuck reporting reason=Deprecated — still asking us to create a
Connection that already existed. Unsticking them meant a meaningless annotation to force a
reconcile:

kubectl -n <ns> annotate temporalconnections.temporal.io temporal-cloud migration-poke=retry --overwrite

All of them flipped to MigratedToConnection within about twenty seconds, so the status logic is
right — only the trigger was missing. DeprecatedTCReconciler watched just its own kind, and
nothing outside that reconciler ever writes to a TemporalConnection, so creating the Connection
never enqueued it.

This PR adds a watch on Connection so the replacement enqueues the deprecated resource. Names are
1:1, so EnqueueRequestForObject maps it directly, and no RBAC change is needed — the reconciler
already declares get;list;watch on connections.

DeprecatedTWDReconciler has the same missing watch but does not need it in practice:
migrateFromDeprecatedTWD patches the migrated-to-wd label onto the deprecated object, and that
write wakes the reconciler. Connections have no equivalent write, so they need the nudge.

…tatus

DeprecatedTCReconciler only watched TemporalConnection. It decides its status
by looking up whether a same-named Connection exists, but nothing outside the
reconciler ever writes to a TemporalConnection, so creating the Connection did
not enqueue it and the status stayed stale — still telling users to create a
Connection that already existed.

Watch Connection so the replacement enqueues the deprecated resource. Names are
1:1, so EnqueueRequestForObject maps it directly. No RBAC change is needed: the
reconciler already declares get;list;watch on connections.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@htonkovac
htonkovac requested review from a team, eniko-dif and jlegrone as code owners August 23, 2026 02:23
@CLAassistant

CLAassistant commented Aug 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tomba7

tomba7 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Hey @htonkovac, thanks for issuing this PR. We'll get to this shortly. In the meantime is there an open issue that is associated with this PR?

@htonkovac

Copy link
Copy Markdown
Author

hey @tomba7, sorry, I haven't opened an issue for this. I simply encountered this while upgrading my companies installation of the controller.

@jaypipes

Copy link
Copy Markdown
Collaborator

hey @tomba7, sorry, I haven't opened an issue for this. I simply encountered this while upgrading my companies installation of the controller.

No worries at all, @htonkovac! We can create a tracking issue for it, no problem :)

@jaypipes

Copy link
Copy Markdown
Collaborator

@htonkovac all done! #548

@jaypipes jaypipes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 thank you @htonkovac, appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants