Skip to content

feat(vmop): add superseded phase#2492

Open
danilrwx wants to merge 2 commits into
mainfrom
feat/vmop/add-superseded-phase
Open

feat(vmop): add superseded phase#2492
danilrwx wants to merge 2 commits into
mainfrom
feat/vmop/add-superseded-phase

Conversation

@danilrwx

@danilrwx danilrwx commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

Add a dedicated Superseded terminal phase for VirtualMachineOperation.

Previously, a VMOP interrupted by a newer operation for the same VM was set to phase: Completed with conditions[Completed].reason: Superseded. This made superseded operations indistinguishable from successfully completed ones without inspecting condition details.

Changes:

  • VMOPPhaseSuperseded added to the API enum and CRD schema (EN + RU docs).
  • markSuperseded in vmop service now sets status.phase=Superseded instead of Completed.
  • Lifecycle snapshot handler recovers the correct phase from conditions: reason=Supersededphase=Superseded.
  • IsFinished() and all terminal phase checks across vm, vmop, metrics, CLI, and e2e now include Superseded.
  • Metrics: Superseded phase exposed in the status-phase metric; finishedAt timestamp recorded for superseded VMOPs; Superseded reason counted as a successful terminal reason.
  • CLI wait no longer hangs on superseded VMOPs; outputs a superseded message with condition details.
  • Internal migration lifecycle doc updated with the Superseded state.

Why do we need it, and what problem does it solve?

When a user or automation creates a new VMOP that supersedes an in-flight one, the older VMOP appears as Completed — the same phase as a successfully finished operation. Any tooling that checks phase == Completed as a success signal gets a false positive. A dedicated phase makes the terminal state unambiguous.

What is the expected result?

  1. Create a VMOP for a VM.
  2. Create a second VMOP for the same VM, superseding the first.
  3. Verify the older VMOP shows:
    • status.phase: Superseded
    • conditions[Completed].status: "True"
    • conditions[Completed].reason: Superseded
  4. Verify CLI wait exits immediately on a superseded VMOP (does not hang).
  5. Verify metrics expose the Superseded phase and record a finishedAt timestamp.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: api
type: feature
summary: "Add the Superseded phase for VirtualMachineOperation resources interrupted by a newer operation."

@danilrwx danilrwx added this to the v1.10.0 milestone Jun 16, 2026
@danilrwx danilrwx force-pushed the feat/vmop/add-superseded-phase branch from a62ae41 to 29ceb47 Compare June 16, 2026 07:40
@danilrwx danilrwx marked this pull request as ready for review June 16, 2026 07:40
danilrwx added 2 commits June 26, 2026 17:46
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx force-pushed the feat/vmop/add-superseded-phase branch from 29ceb47 to 96711f8 Compare June 26, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant