fix(workflows): declare the Secrets the bake and the prune mount #439
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/workflows-forgejo-tokens"
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?
Moving the bake and the prune off Argo fixed their ServiceAccount and left a second, quieter break behind. The bake reached the cluster and stopped dead:
Neither Secret was declared in this repo. Both exist only in
ns forgejo, and the ExternalSecrets that mirrored them intons workflowslived insean/pipelinesand died with that application -- the same cause as the ServiceAccount, one layer down.registry-package-prunehad the identical gap onforgejo-admin-tokenand would have failed at 05:17 rather than now.Why this one is nastier than the ServiceAccount
A missing ServiceAccount refuses pod creation and says so in the event. A missing Secret lets the pod be created and leaves kubelet retrying the mount, so it sits in
PodInitializingwith no container, no logs, and no stated cause untilactiveDeadlineSecondsburns.node-snapshot-bake's own header blames an earlier death on "the container never started". That is the shape a missing Secret makes -- r3 may well have been this.A third gap, found while auditing the first two
The
codeberg-credsExternalSecret inns workflowscarriesargocd.argoproj.io/tracking-id: argo-workflows:.... It belongs to the ArgoCD application we are retiring, and both Jobs mount the Secret it produces.Its
target.deletionPolicyisRetain, so the Secret would have outlived the ArgoCD prune and hidden the gap until the nextmake rebuild-- exactly the failure the north star forbids. It is declared here now, under the same name so the existing object is adopted rather than raced by a second ExternalSecret. Expect ArgoCD to showargo-workflowsOutOfSync on ownership annotations until that app is deleted.hcloud-tokenandbake-ssh-keywere checked too and are fine: SOPS sources in this repo, applied tons workflowsby FluxtargetNamespace.r8
The r7 Job is wedged on the missing mount and carries
backoffLimit: 0, so it will not recover on its own. An rN bump is the declarative retry this manifest already asks for, in preference to deleting the Job by hand.Guard
tests/workflows-secret-declarations.shfails when a Job or CronJob in either component mounts a Secret that no manifest in this repo declares -- the class, not the three instances. Scoped to these two components on purpose: several Secrets here come from SOPS sources or other components, and a scanner that guesses namespaces produces false positives that get silenced, which is worse than no guard.Three negative controls, each hiding one declaring file from the repo-wide scan. The first version deleted the file from a copy of the component and was inert, because the real declaration was still on disk and still satisfied the scan.
bash tests/check.shexits 0. Server-side dry run applies all seven objects clean.https://claude.ai/code/session_01KZoQin34jeyt6nDGqvJA76