fix: make the stage db-migrate Job a PreSync hook #7
No reviewers
Labels
No labels
bug
contribution welcome
duplicate
enhancement
good first issue
help wanted
invalid
question
upstream
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
feeldata/manifests!7
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/stage-db-migrate-presync-hook"
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?
Unblocks the
feeldata-stagesync, which has been failing since #6 merged.Symptom
ArgoCD retries forever. Because the sync operation fails as a whole,
Deployment/api,Deployment/graphqlandDeployment/webnever get applied — stage is still running Codeberg images while dev and prod have moved.Cause
A Job's
spec.templateis immutable. Withoutargocd.argoproj.io/hook, ArgoCD treats the Job as an ordinary resource and PATCHes the pod template on every change, which the API server rejects. Theargocd.argoproj.io/hook-delete-policy: BeforeHookCreationannotation already present is inert — it only takes effect on resources that are actually hooks.devandprodboth carryargocd.argoproj.io/hook: PreSync. Stage does not:hook: PreSynchook-delete-policysync-waveThis is pre-existing drift, not something #6 introduced. It went unnoticed for as long as
feeldata-stagewas hand-applied and off GitOps — the image repoint is simply the first pod-template change ever to reach it through ArgoCD.Also needed
The stuck
db-migrateJob infeeldata-stagemust be deleted once for the sync to get past it; after thatBeforeHookCreationhandles replacement on every future sync. The Job isCompleteand idempotent (it checks alembic state and exits early if already at head), so deleting it is safe.