Skip to content

fix(k8s): delete ended pods before the old claim in volume move #7465

Done

Description

@dan-petty

Problem

devops k8s volume move leaves pods that have ended (phase Succeeded/Failed) out of its plan (#7431), but such a pod still holds the claim: the claim protection of the cluster lists it under "Used By", so the delete of the old claim (step 9, the point of no return) waits until its timeout, and the move stops stranded.

Evidence of 2026-11-27 on the homelab: devops k8s volume move gitea/gitea-shared-storage --storage-class longhorn copied and compared the data, then kubectl delete pvc gitea-shared-storage timed out; kubectl describe pvc named the ended pod gitea-6887856b4c-6sn4d (an old ReplicaSet, phase Succeeded) as a user. The same held the claim devops/renovate-cache (three ended Renovate pods) the same day.

Change

Before the delete of the old claim (or in the stop step), the run deletes each ended pod that names the claim in its volumes, after it adds no undo for it (the pod has ended and holds no data). The plan prints these pods. Alternatively the plan refuses while such pods exist and names them.

Acceptance criteria

  • A failing test first: with an ended pod of the claim, the run deletes it before the delete of the old claim, and the move ends.
  • devops ci checks pass.

Related: #7431, #7382, dan-petty/homelab#472.

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    status/new
    value/medium
    priority/p2-medium
    effort/low
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 27, 2026
  2. removed
    status/in-review
    owner/agent
    on Nov 27, 2026
  3. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-27 22:58 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions