Include cluster UID in CONTROLLER_IDENTITY to prevent cross-cluster conflicts#309
Merged
Include cluster UID in CONTROLLER_IDENTITY to prevent cross-cluster conflicts#309
Conversation
…ontroller-on-controller fighting
Controllers that previously set ManagerIdentity as "release/namespace" (pre-cluster-UID) or "temporal-worker-controller" (pre-Helm default) would be permanently blocked from managing existing Worker Deployments after upgrading, since shouldClaimManagerIdentity only triggered on empty identity. Now reclaims in both migration cases: - exact match on the old hardcoded default - new identity is a longer slash-prefixed version of the existing one Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… distinct test identity - defaults.ControllerIdentity is now DeprecatedDefaultControllerIdentity to make clear it exists only for upgrade migration detection, not as a live default - integration tests use a dedicated testControllerIdentity constant so they exercise the normal identity path rather than accidentally triggering the deprecated-identity migration branch Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SetManagerIdentity with an empty identity clears the ManagerIdentity field on the Worker Deployment, leaving it ownerless. Add an explicit check and return an error rather than making the call. The startup check in main() is the primary enforcement; this is a targeted guard for the one call site where an empty value is actively dangerous. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
carlydf
added a commit
that referenced
this pull request
Apr 28, 2026
…s-cluster conflicts (#308) <!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please **make sure there is an open issue** for this. We work best with you when we have accepted the idea first before you code. --> <!--- For ALL Contributors 👇 --> ## What was changed In `shouldClaimManagerIdentity`, detect future format of manager identity ## Why? To facilitate clean reclaim after rollback from the next release, which will include #309 ## Checklist <!--- add/delete as needed ---> 1. Closes <!-- add issue number here --> 2. How was this tested: Envtest won't test our get ns permissions, so just trusting there (we will test it in CI env because it runs on controller startup) 3. Any docs updates needed? <!--- update README if applicable or point out where to update docs.temporal.io --> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Completes the two-release migration for including the cluster namespace UID in the controller identity string.
Previously, the new
{identity}/{namespaceUID}format was prepared behind a "next release" comment while the bare{identity}string remained active. This PR flips that:getControllerIdentity()now returns the full{identity}/{suffix}format, andgetDeprecatedControllerIdentity()handles reclamation of Worker Deployments previously claimed under the old format.Changes:
getControllerIdentity()now returns{CONTROLLER_IDENTITY}/{CONTROLLER_IDENTITY_SUFFIX}; returns empty string if either is unsetgetDeprecatedControllerIdentity()(renamed fromgetControllerIdentityWithNamespaceUID) is used only for backward-compatible reclamationmain()fails fast ifCONTROLLER_IDENTITYis unsetReconcile()for library users who bypassmain()requires thatgetControllerIdentity() != ""claimManagerIdentity()refuses to callSetManagerIdentitywith an empty string to prevent accidental field clearingToBeDeprecatedDefaultControllerIdentity→DeprecatedDefaultControllerIdentityIdentityEnvKeyandIdentitySuffixEnvKey