Skip to content

fix(trakrf-backend): omit JWT_SECRET when placeholder/empty (bulletproof preview-rollout fix) - #133

Merged
mikestankavich merged 1 commit into
mainfrom
miks2u/backend-jwt-secret-omit-default
May 29, 2026
Merged

fix(trakrf-backend): omit JWT_SECRET when placeholder/empty (bulletproof preview-rollout fix)#133
mikestankavich merged 1 commit into
mainfrom
miks2u/backend-jwt-secret-omit-default

Conversation

@mikestankavich

Copy link
Copy Markdown
Contributor

Why

Rendering the chart's placeholder secrets.jwtSecret: change-me made ArgoCD own and revert the operator-set JWT_SECRET on every sync/image-update → the backend's TRA-860/#428 fail-fast guard refused to boot → preview rollouts silently stalled (new pod CrashLoopBackOff, old pod held). The ignoreDifferences+RespectIgnoreDifferences carve-out (PR #132) did not reliably survive the image-update sync path.

What

secret.yaml now renders JWT_SECRET only when secrets.jwtSecret is a real, non-default value. With the default (change-me) or empty, the key is omitted → ArgoCD never manages /data/JWT_SECRET → the out-of-band operator-set value persists across all sync paths (selfHeal, image-update, apply-root-app).

Verified via helm template: default/empty → JWT_SECRET absent; real value → rendered. helm lint clean.

Behavior

  • Fail-closed for fresh envs: no secret → guard refuses to boot until a real one is set (matches #428 intent + the ESO direction). At prod cutover, blast the real JWT_SECRET after deploy.
  • Belt-and-suspenders: the trakrf-backend Application keeps the fix(argocd/root): make operator-set JWT_SECRET survive ArgoCD sync (durable preview unblock) #132 ignoreDifferences carve-out (now redundant but harmless).
  • Durable follow-up (TRA-375): External Secrets + GCP Secret Manager as the real source.

Chart change only — propagates via the child Application's git sync (no apply-root-app).

🤖 Generated with Claude Code

…er/empty

ArgoCD rendering the chart's placeholder default ("change-me") meant it owned
and reverted the operator-set JWT_SECRET on every sync/image-update — crashing
the backend's fail-fast guard (TRA-860) and silently stalling preview rollouts.
ignoreDifferences+RespectIgnoreDifferences (the trakrf-backend Application
carve-out) did not reliably survive the image-update sync path.

Bulletproof fix: only render JWT_SECRET when secrets.jwtSecret is a real,
non-default value. With the default/empty, the key is omitted, so ArgoCD never
manages /data/JWT_SECRET and the out-of-band operator value persists across ALL
sync paths. Fail-closed for fresh envs (no secret → guard refuses to boot until
a real one is set), matching the ESO+GCP-Secret-Manager direction (TRA-375).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mikestankavich
mikestankavich enabled auto-merge May 29, 2026 14:05
@mikestankavich
mikestankavich merged commit 9bcc587 into main May 29, 2026
20 checks passed
@mikestankavich
mikestankavich deleted the miks2u/backend-jwt-secret-omit-default branch May 29, 2026 14:05
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.

1 participant