Skip to content

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

Done

Description

@dan-petty

Problem

When devops k8s volume move fails before the point of no return, its undo deletes the temporary claim <claim>-move. The volume of that claim stays when its class has the reclaim policy Retain. The class longhorn of the homelab has Retain, so each undone move to it (#7382) leaves a Released Longhorn volume with a partial copy. Longhorn keeps two replicas of it on the storage nodes until a person deletes it.

Evidence of 2026-11-27 on the homelab: a move of a test claim to longhorn failed at the copy (#7408), and the undo deleted the claim data-move. Its volume stayed Released, class longhorn, reclaim policy Retain, until I deleted it by hand about one hour later. A move that keeps the class local-path does not show this: that class has the reclaim policy Delete.

Change

The undo of the step that makes <claim>-move sets the reclaim policy of its volume to Delete before it deletes the claim, when the step got that volume's name. The move made that volume, and it holds no data that the old claim does not hold. Steps 7 and later keep Retain on the new volume as now.

Acceptance criteria

  • A failing test first: an undo after the copy deletes <claim>-move and, before that, patches its volume to Delete.
  • A live move to longhorn that fails before the point of no return leaves no Released volume of the move.
  • devops ci checks pass.

Related: #7382, #7408.

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    status/new
    value/medium
    effort/low
    priority/p2-medium
    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 18:39 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