Skip to content

fix(k8s): end a retrying Argo CD sync in volume move #7485

Done

Description

@dan-petty

Problem

The wait of #7464 runs kubectl wait --for=jsonpath={.status.operationState.finishedAt} while the sync operation of a paused Application is Running. During the backoff between two retries, Argo CD sets finishedAt and keeps the phase Running. Evidence of 2026-11-27 23:18 UTC, Application danielpetty-com: phase=Running startedAt=23:07:12 finishedAt=23:18:04 retryCount=2, and the next attempt ran at 23:18:24. So the wait ends at once and the operation goes on, which can make a deleted claim again from git.

Change

When the phase of the operation of a paused Application is Running, the run ends the operation: it patches status.operationState.phase to Terminating, as argocd app terminate-op does, and waits until the phase is no longer Running or Terminating (on the homelab a terminated operation ends Failed with Operation terminated). It fails the step before the point of no return when the operation does not end.

Acceptance criteria

  • A failing test first: an operation in phase Running with finishedAt set is ended and waited for, not taken as finished.
  • devops ci checks pass.

Related: #7464, #7382.

Alternatives check of 2026-11-27: in-use.
The item already names this tool.
Tool: argoproj/argo-cd (https://github.com/argoproj/argo-cd), Apache-2.0, last activity 2026-11-27, maintained.
Reason: Searches found Argo CD, whose CLI argocd app terminate-op patches operationState.phase to Terminating and ends a running sync, so it covers the ending the issue mirrors, but not the phase wait or volume-move ordering.

Covers:

  • Ends a running sync operation through terminate-op
  • Sets operationState.phase to Terminating
  • A terminated operation ends Failed with Operation terminated

Lacks:

  • No wait on the operation phase after terminating
  • No guard against finishedAt set during retry backoff
  • No volume-move ordering or point-of-no-return check

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    status/new
    effort/medium
    value/high
    priority/p2-medium
    on Nov 27, 2026
  2. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Tools considered:

    Searches run:

    • Python client library Argo CD API terminate sync operation, results: 5
    • argocd app terminate-op operationState phase Terminating, results: 5
    • "argocd app terminate-op" documentation, results: 5
    • argo-cd github repository argocd CLI terminate operation, results: 5
    • argoproj argo-cd, results: 5
    • argocd python package pypi, results: 5
    • argo-cd.readthedocs.io argocd_app_terminate-op, results: 5
    • github argoproj argo-cd terminate operation source code, results: 5
    • argo-cd application operationState phase Terminating retry sync operation, results: 5
    • argocd command reference app terminate-op readthedocs operator manual, results: 5

    Sources:

  3. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 28, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 28, 2026
  5. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor

    Replacement check for #7498 (PR #7518, which replaces the volume move copy with pv-migrate): the fix of this issue stays. _settle runs after the pause and again as its own step (step 6) after the copy and before the delete of the old claim, in place of its old place before the delete of the copy pods. test_a_running_sync_of_a_paused_application_is_waited_for checks the two runs and their order.

  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-28 02:40 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/mediumpriority/p2-mediumscope/k8ssource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions