Repository navigation
Description
Problem
devops k8s volume move pauses an Argo CD Application with spec.syncPolicy.automated.enabled: false. An Application that an ApplicationSet owns gets its spec back from the template of the ApplicationSet, so the pause does not hold. On 2026-11-27 the ApplicationSet service-workloads of the homelab set the automated sync of danielpetty-com back on within about 30 s of a pause (its ignoreApplicationDifferences covers only /spec/source/kustomize/images), and a new automated sync started at 23:18:54 UTC. A move under such a pause can meet a sync that makes the deleted claim again from git (as in dan-petty/homelab#472).
Change
The plan reads the owner references of each Application that it would pause. When an ApplicationSet owns one, the plan refuses the move, names the ApplicationSet, and says that it must leave /spec/syncPolicy of that Application alone (ignoreApplicationDifferences) before a pause can hold.
Acceptance criteria
- A failing test first: the plan of a claim whose Application an ApplicationSet owns, with no ignore of
/spec/syncPolicyfor it, refuses and changes nothing. devops cichecks pass.
Related: #7382, #7464, dan-petty/danielpetty.com#108.
Alternatives check of 2026-11-27: in-use.
The item already names this tool.
Tool: argoproj/argo-cd (https://github.com/argoproj/argo-cd), Apache-2.0, last activity 2026-11-27, maintained.
Reason: Searches found only Argo CD itself: its ApplicationSet controller defines ignoreApplicationDifferences and sets owner references, but it never refuses a volume move or checks that a pause survives reconciliation.
Covers:
- ApplicationSet spec carries ignoreApplicationDifferences JSON pointer paths
- Owner references on each Application name its ApplicationSet
- API and CLI return Application and ApplicationSet as JSON
Lacks:
- No refusal or dry-run guard for volume moves
- No check that a pause survives ApplicationSet reconciliation
- No volume or claim move command
Proposed design
Problem statement
devops k8s volume move pauses an Argo CD Application with spec.syncPolicy.automated.enabled: false. An ApplicationSet restores the Application spec from its template, so the pause does not hold and a new automated sync can recreate a deleted claim from git. The plan must read the owner reference of each Application that it would pause and the owning ApplicationSet's ignoreApplicationDifferences, and it must refuse the move before any change when no JSON pointer covers the pause field.
Acceptance criteria
Requirement: Refuse an owned Application with no pause ignore
The plan SHALL refuse a move when an ApplicationSet owns an Application that it would pause and no ignoreApplicationDifferences JSON pointer of the ApplicationSet covers /spec/syncPolicy/automated/enabled.
Scenario: Owned Application with no pause ignore
- WHEN A unit test in
tests/k8s/test_k8s_volume_move.pyplans a claim move and fakes an Application that an ApplicationSet owns and whoseignoreApplicationDifferenceshas only the pointer/spec/source/kustomize/images. - THEN The plan raises
VolumeMoveRefusedErrorwhose problems name the ApplicationSet and say to ignore/spec/syncPolicy, and the fake cluster records no change.
Requirement: Allow a pause that the ApplicationSet ignores
The plan SHALL allow the move when an ignoreApplicationDifferences JSON pointer of the ApplicationSet covers the pause field.
Scenario: ApplicationSet with a covering ignore
- WHEN A unit test plans the move and the ApplicationSet has one of the pointers
/spec/syncPolicyand/spec/syncPolicy/automated/enabledfor the Application. - THEN The plan pauses the Application and returns the move plan with no refusal.
Requirement: Keep unowned Applications unchanged
The plan SHALL pause and move an Application that no ApplicationSet owns as it did before.
Scenario: Application with no ApplicationSet owner
- WHEN A unit test plans the move for an Application whose
metadata.ownerReferenceshas no entry withkind: ApplicationSet. - THEN The plan pauses the Application and returns the move plan with no refusal.
Requirement: The refusal test fails before the fix
The change MUST add a test that fails on the base commit and passes with the guard.
Scenario: Fail-to-pass replay
- WHEN A developer runs
uv run pytest tests/k8s/test_k8s_volume_move.py -k applicationset_ownedon the base commit and then on the head commit. - THEN The test fails on the base commit and passes on the head commit.
Requirement: CI checks pass
The change MUST pass the project CI checks.
Scenario: Project CI
- WHEN A developer runs
uv run devops ci. - THEN The command exits 0 and each check passes.
Existing Tool Considered
argoproj/argo-cd (https://github.com/argoproj/argo-cd), verdict in-use, because the item already names the tool. The alternatives check of 2026-11-27 in the issue body records what the tool covers and lacks. The change adds the refusal guard and the pause-survival pre-check in src/devops_cli/k8s/volume_move.py; it adds no move command, because PR #7518 replaces the copy with pv-migrate. The change builds its own code: about 8,000 tokens and 2 hours to build, and about 1,000 tokens per later fix; no new dependency for the guard.
Key questions
- How does the plan identify the ApplicationSet that owns an Application?: The plan reads
metadata.ownerReferencesof each Application that it would pause, takes the entry withkind: ApplicationSetandapiVersion: argoproj.io/v1alpha1, and reads that ApplicationSet by name. The plan adds this read; it does not read owner references today. (best practice) [sources: src/devops_cli/k8s/volume_move.py, src/devops_cli/config/constants.py]- Chosen: metadata.ownerReferences. Kubernetes and Argo CD set the owner reference on the Application, and the reference names the ApplicationSet directly.
- Rejected: ApplicationSet name from the Application name. A name can differ from the owner and is not proof of ownership.
- Rejected: List each ApplicationSet and match its selectors. It needs the generator inputs, and it can match an ApplicationSet that does not own the Application.
- How does the plan decide that an ApplicationSet leaves the pause field alone?: The plan reads
spec.ignoreApplicationDifferencesof the owning ApplicationSet and accepts a JSON pointer that equals/spec/syncPolicy/automated/enabledor is a path prefix of it, such as/spec/syncPolicyor/spec/syncPolicy/automated. It refuses when no pointer covers that field. (best practice) [sources: src/devops_cli/k8s/volume_move.py, src/devops_cli/infra/nodes.py]- Chosen: JSON pointer prefix cover. The pause writes
spec.syncPolicy.automated.enabled, and a pointer to a parent path ignores its children. - Rejected: Exact
/spec/syncPolicyonly. It refuses a valid narrower ignore such as/spec/syncPolicy/automated/enabled. - Rejected: Any ignore entry. An ignore for
/spec/source/kustomize/imagesdoes not keep the pause.
- Chosen: JSON pointer prefix cover. The pause writes
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 27, 2026
A demonstrated failure where the pause does not hold, risking data corruption in a destructive move.Both address the pause not holding for an ApplicationSet-owned Application, but #7485 ends a retrying sync while the candidate refuses the move.devops-cli-service commentedon Nov 27, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
dan-petty commentedon Nov 28, 2026
Replacement check for #7498 (PR #7518, which replaces the volume move copy with pv-migrate): not fixed, and not in scope of the copy. pv-migrate does only the copy. The pause of Argo CD, the end of the running syncs and the plan stay in
src/devops_cli/k8s/volume_move.py, unchanged in their logic, so the plan still does not read the owner references of an Application. The issue stays open.devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.232.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.232.4
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 06:56 UTC