forked from roger/k3s-cluster
fix(myorg-assistant): mirror Deployment env (GIT_*, WEB_SECRET_KEY) into all cronjobs
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.
This commit is contained in:
@@ -34,6 +34,26 @@ spec:
|
||||
- "from src.scheduler.jobs import run_job; import sys; run_job(sys.argv[1])"
|
||||
- evening-summary
|
||||
env:
|
||||
- name: GIT_REPO_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: myorg-assistant-secret
|
||||
key: GIT_REPO_URL
|
||||
- name: GIT_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: myorg-assistant-secret
|
||||
key: GIT_USERNAME
|
||||
- name: GIT_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: myorg-assistant-secret
|
||||
key: GIT_TOKEN
|
||||
- name: GIT_BRANCH
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: myorg-assistant-config
|
||||
key: GIT_BRANCH
|
||||
- name: MYORG_REPO_PATH
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
@@ -54,6 +74,11 @@ spec:
|
||||
secretKeyRef:
|
||||
name: myorg-assistant-secret
|
||||
key: LITELLM_API_KEY
|
||||
- name: WEB_SECRET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: myorg-assistant-secret
|
||||
key: WEB_SECRET_KEY
|
||||
volumeMounts:
|
||||
- name: myorg-data
|
||||
mountPath: /data/myorg
|
||||
|
||||
Reference in New Issue
Block a user