Skip to content

fix(k8s): wait for running Argo CD syncs in a volume move - #7469

Merged
dan-petty merged 4 commits into
mainfrom
fix/7464-volume-move-wait-argo-sync
Nov 27, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/7464-volume-move-wait-argo-sync

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops k8s volume move waits until no paused Argo CD Application runs a sync operation: after the pause, and again before it deletes the copy pods. A pause turns off automated sync, but an operation that already runs goes on, and it can make the deleted claim again from git with an empty volume. After a merge of a class change, the automated sync fails on the immutable claim and retries, so a move soon after the merge meets such an operation.

The run reads status.operationState.phase of each paused Application and, while it is Running or Terminating, waits with kubectl wait for finishedAt, up to 600 s. A timeout fails the step before the point of no return, so the run undoes its steps.

Closes #7464

Change: openspec/changes/archive/2026-11-27-7464-volume-move-wait-argo-sync/

@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 27, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Evidence, 2026-11-27, homelab:

Check Result
The incident (dan-petty/homelab#472) Application gitea: operation startedAt 19:47:53, 2 retries, finishedAt 19:48:27; automated.enabled false from 19:48:04. At 19:48:27 the operation made gitea/gitea-shared-storage from git (new empty Longhorn volume) and set the Deployment to 1 replica. Recovered by hand, no data lost
kubectl wait application/bootstrap -n argocd --for=jsonpath='{.status.operationState.finishedAt}' --timeout=5s with the field set condition met at once
The same with a field that is not set error: timed out waiting for the condition

The unit tests hold the order: the waits come after the pauses and again before delete pod <claim>-src <claim>-dst, and a wait that times out undoes the move with no delete of the old claim. This PR and PR 7468 both add a step near the delete of the copy pods and of the old claim; the second to merge needs a rebase.

@dan-petty
dan-petty marked this pull request as ready for review November 27, 2026 20:11
@devops-cli-service

Copy link
Copy Markdown
Contributor

Pull request #7469 has merge conflicts with main at commit a809a568da19. GitHub cannot merge it. Rebase the branch onto the current main, resolve the conflicts and push the branch.

@dan-petty
dan-petty enabled auto-merge (squash) November 27, 2026 20:13
@dan-petty
dan-petty merged commit 6d66f06 into main Nov 27, 2026
27 checks passed
@dan-petty
dan-petty deleted the fix/7464-volume-move-wait-argo-sync branch November 27, 2026 20:19
dan-petty-release Bot added a commit that referenced this pull request Nov 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.229.3](v0.229.2...v0.229.3)
(2026-11-27)


### Bug Fixes

* **k8s:** wait for running Argo CD syncs in a volume move
([#7469](#7469))
([6d66f06](6d66f06))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): wait for running Argo CD syncs in a volume move

1 participant