Skip to content

fix(k8s): delete the new volume when a volume move undoes - #7429

Merged
dan-petty merged 1 commit into
mainfrom
fix/7416-volume-move-undo-deletes-volume
Nov 27, 2026
Merged

dan-petty merged 1 commit into
mainfrom
fix/7416-volume-move-undo-deletes-volume

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

When devops k8s volume move fails before the point of no return, its undo now deletes the volume that the move made for <claim>-move. Before, it deleted only the claim, and a class with the reclaim policy Retain, such as longhorn, kept the volume with a partial copy and its replicas.

The undo reads the volume of <claim>-move when it runs, sets its reclaim policy to Delete, and then deletes the claim. A class with Immediate binding makes the volume before the destination pod starts, so the run could not know it at an early failure.

Closes #7416

Change: openspec/changes/archive/2026-11-27-7416-volume-move-undo-deletes-volume/

@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

Live check on the homelab, 2026-11-27, with the branch build.

Check Result
Earlier, main: an undone move to longhorn the volume of data-move stayed Released, class longhorn, policy Retain, until deleted by hand
This branch: timeout -s INT 12 devops k8s volume move <ns>/data --storage-class longhorn (interrupt while the move waits for data-dst; Longhorn binds data-move at once) Undo: Delete pod data-dst. Undo: Delete NetworkPolicy data-copy. Undo: Set the reclaim policy of the volume of claim data-move to Delete, and delete the claim.
After the undo no PersistentVolume of data-move; the only Longhorn volume in the cluster is the one of Open WebUI; the old claim stays Bound and its pod Running

The test namespace and its volume are deleted.

@dan-petty
dan-petty marked this pull request as ready for review November 27, 2026 15:57
@dan-petty
dan-petty merged commit 82c2c5c into main Nov 27, 2026
27 checks passed
@dan-petty
dan-petty deleted the fix/7416-volume-move-undo-deletes-volume branch November 27, 2026 16:10
dan-petty-release Bot added a commit that referenced this pull request Nov 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.226.1](v0.226.0...v0.226.1)
(2026-11-27)


### Bug Fixes

* **k8s:** delete the new volume when a volume move undoes
([#7429](#7429))
([82c2c5c](82c2c5c))

---
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): delete the new volume when a volume move undoes

1 participant