fix(myorg-assistant): mirror Deployment env (GIT_*, WEB_SECRET_KEY) into all cronjobs #23
Reference in New Issue
Block a user
No description provided.
Delete Branch "platform-engineer-agent/k3s-cluster:fix/myorg-cronjob-env-parity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
myorg-git-sync was crash-looping: 4.19 restarts per 15m (pod myorg-git-sync-29731995-wbdnx). Loki stderr showed a pydantic Settings validation error for the missing WEB_SECRET_KEY field, raised at src/config.py line 44 (Settings()) at import time, which kills the container before it does any work.
The myorg-assistant Deployment's pydantic Settings model requires WEB_SECRET_KEY (and the GIT_* set for git-sync / deadline-checker). The cronjobs carried only a subset of env, so every scheduled run crashed at import.
Fix
Mirror the Deployment's full required env into all 5 cronjobs, per file (no duplicates):
Supersedes PRs 19, 20, 21
Those PRs added ONLY WEB_SECRET_KEY and left the GIT_* gap. deadline-checker (and the others) are still missing the whole GIT_* set, so merging them would NOT stop the recurring loop. This PR is complete.
Delivery
Fork-branch plus PR only (agent cannot push upstream and cannot merge). Roger: merge this and close 19/20/21, then ArgoCD self-heals and the restart loop stops.
The myorg-assistant Deployment's Settings() requires WEB_SECRET_KEY (and the GIT_* set for git-sync/deadline-checker). The cronjobs only carried a subset, so every run crashed at import with: pydantic_core._pydantic_core.ValidationError: 1 validation error for Settings web_secret_key [type=missing] myorg-git-sync was crash-looping (4.19 restarts/15m, pod 29731995-wbdnx). deadline-checker/evening-summary/morning-briefing/waiting-followup were also missing the full env set (git-sync already had GIT_*, but lacked WEB_SECRET_KEY; the others lacked both GIT_* and WEB_SECRET_KEY). Mirror the Deployment's full required env (GIT_REPO_URL/USERNAME/TOKEN/BRANCH from secret/configmap, WEB_SECRET_KEY from secret) into every cronjob so import-time Settings() validation passes for all. Supersedes the incomplete PRs #19/#20/#21 (which added only WEB_SECRET_KEY and left the GIT_* gap). Roger: merge -> ArgoCD self-heals, loop stops.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.