Skip to content

fix(k8s): delete late-bound move volume by claim UID - #7633

Merged
dan-petty merged 2 commits into
mainfrom
fix/7452-delete-late-bound-move-volume
Nov 28, 2026
Merged

dan-petty merged 2 commits into
mainfrom
fix/7452-delete-late-bound-move-volume

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Captures <claim>-move's UID before deleting the claim on undo and waits within a bounded interval after deletion to set any PersistentVolume matching spec.claimRef.uid to reclaim policy Delete.

Closes #7452

Summary

  • Read both metadata.uid and spec.volumeName from <claim>-move via kubectl get pvc ... -o json in src/devops_cli/k8s/volume_move.py before deleting the claim.
  • Preserve pre-delete Delete patching when spec.volumeName is set.
  • When <claim>-move holds a UID and no spec.volumeName, poll kubectl get pv -o json up to DEFAULT_K8S_VOLUME_MOVE_LATE_VOLUME_WAIT_SECONDS after deleting the claim and patch every PersistentVolume matching spec.claimRef.uid to Delete.
  • Add regression tests in tests/k8s/test_k8s_volume_move.py covering immediate and polled late-bound PersistentVolume cleanup.

Verification

  • uv run devops ci test tests/k8s/test_k8s_volume_move.py (96 passed)
  • uv run devops ci fail-to-pass --base origin/main (2 new tests fail on origin/main and pass on head)
  • uv run devops ci --check --no-cache --skip test,outdated (27/27 checks passed)

Change: openspec/changes/archive/2026-11-28-7452-delete-late-bound-move-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 28, 2026
@dan-petty
dan-petty marked this pull request as ready for review November 28, 2026 20:47
@dan-petty
dan-petty merged commit abeebd8 into main Nov 28, 2026
27 checks passed
@dan-petty
dan-petty deleted the fix/7452-delete-late-bound-move-volume branch November 28, 2026 20:48
dan-petty-release Bot added a commit that referenced this pull request Nov 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.240.1](v0.240.0...v0.240.1)
(2026-11-28)


### Bug Fixes

* **docs:** fix stale statements found by the content census
([#7632](#7632))
([7eed4ac](7eed4ac))
* **infra:** render infra.repos in ConfigMap and drift exit
([#7631](#7631))
([24d2193](24d2193))
* **k8s:** delete late-bound move volume by claim UID
([#7633](#7633))
([abeebd8](abeebd8))
* **roadmap:** brain sync rewrites stale near lists of unchanged
neighbours
([#7629](#7629))
([ac36afe](ac36afe))


### Performance Improvements

* **tests:** keep 4 heaviest invariant files under 15 s
([#7630](#7630))
([724426f](724426f)),
closes [#4890](#4890)

---
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 a move volume bound after the undo

1 participant