Skip to content

Commit fbde10c

Browse files
carlydfclaude
andcommitted
reclaim manager identity when upgrading from old identity format
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>
1 parent c8be5a7 commit fbde10c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

internal/controller/execplan.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515

1616
"github.com/go-logr/logr"
1717
temporaliov1alpha1 "github.com/temporalio/temporal-worker-controller/api/v1alpha1"
18+
"github.com/temporalio/temporal-worker-controller/internal/defaults"
1819
"github.com/temporalio/temporal-worker-controller/internal/k8s"
1920
"github.com/temporalio/temporal-worker-controller/internal/planner"
2021
enumspb "go.temporal.io/api/enums/v1"
@@ -184,7 +185,16 @@ func (r *TemporalWorkerDeploymentReconciler) startTestWorkflows(ctx context.Cont
184185
}
185186

186187
func (r *TemporalWorkerDeploymentReconciler) shouldClaimManagerIdentity(vcfg *planner.VersionConfig) bool {
187-
return vcfg.ManagerIdentity == ""
188+
existing := vcfg.ManagerIdentity
189+
if existing == "" {
190+
return true // unclaimed
191+
}
192+
if existing == defaults.ControllerIdentity {
193+
return true // pre-Helm hardcoded default
194+
}
195+
// Pre-cluster-UID Helm format was "release/namespace"; new format is
196+
// "release/namespace/{uid}". Reclaim if ours is a longer version of theirs.
197+
return strings.HasPrefix(getControllerIdentity(), existing+"/")
188198
}
189199

190200
func (r *TemporalWorkerDeploymentReconciler) claimManagerIdentity(

0 commit comments

Comments
 (0)