Skip to content

Commit bc0eb7f

Browse files
carlydfclaude
andcommitted
add identity check in Reconcile as fallback for library-import callers
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4f88ede commit bc0eb7f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

internal/controller/worker_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ func (r *TemporalWorkerDeploymentReconciler) Reconcile(ctx context.Context, req
133133
defer cancel()
134134

135135
l := log.FromContext(ctx)
136+
137+
// Fallback identity check for when the reconciler is used as a library and
138+
// main() is not in the call path. main() is kept as the primary check for
139+
// faster feedback in normal Helm-based deployments.
140+
if getControllerIdentity() == "" {
141+
return ctrl.Result{}, fmt.Errorf("CONTROLLER_IDENTITY environment variable is not set")
142+
}
143+
136144
l.V(1).Info("Running Reconcile loop")
137145

138146
// Fetch the worker deployment

0 commit comments

Comments
 (0)