Skip to content

fix(core): run firmware upgrade migration only for running vmi#2162

Merged
danilrwx merged 7 commits intomainfrom
fix/vmop/migration-complete-message
Mar 27, 2026
Merged

fix(core): run firmware upgrade migration only for running vmi#2162
danilrwx merged 7 commits intomainfrom
fix/vmop/migration-complete-message

Conversation

@danilrwx
Copy link
Copy Markdown
Contributor

@danilrwx danilrwx commented Mar 26, 2026

Description

Adjust firmware update behavior to avoid signaling outdated firmware for non-running instances and keep workload-updater migration flow driven by VM condition + virt-controller readiness.

Functional changes

  1. pkg/controller/vm/internal/firmware.go

    • FirmwareUpToDate=False is now set only when KVVMI is Running and launcher image differs.
    • For non-running KVVMI phases (Succeeded, Failed, etc.) the firmware condition is not raised.
  2. pkg/controller/workload-updater/internal/handler/firmware.go

    • Handler flow now relies on:
      • needUpdate(vm) (VM condition),
      • isVirtControllerUpToDate(...).
    • Obsolete KVVMI-specific gate in this handler path is removed.

Test changes

  • Updated VM firmware handler tests (pkg/controller/vm/internal/firmware_test.go) with explicit non-running KVVMI cases (Succeeded, Failed).
  • Updated workload-updater firmware tests (pkg/controller/workload-updater/internal/handler/firmware_test.go) to match current handler contract and removed obsolete KVVMI-centric checks.
  • Added/kept branch tests for launcher image parsing and readiness checks.

Validation:

  • go test ./pkg/controller/vm/internal/...
  • go test ./pkg/controller/workload-updater/internal/handler/...
  • task lint:go

All pass.

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

Previously, firmware-outdated condition could stay active for non-running instances, which was noisy and could trigger misleading update flows.

With this change:

  • condition semantics are aligned with actionable state (running workload only),
  • migration decisions stay consistent with VM condition and controller readiness,
  • test suite matches current behavior and guards regressions.

What is the expected result?

  1. For non-running KVVMI phases (Succeeded, Failed), VM should not expose FirmwareUpToDate=False due to image mismatch.
  2. For running KVVMI with image mismatch, VM should expose FirmwareUpToDate=False.
  3. Workload-updater triggers migration only when firmware update is needed and virt-controller is ready/up-to-date.

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: core
type: fix
summary: "Set firmware outdated condition only for running VM instances and align firmware workload-updater checks with current condition-driven flow."
impact_level: low

@danilrwx danilrwx added this to the v1.8.0 milestone Mar 26, 2026
@danilrwx danilrwx marked this pull request as ready for review March 26, 2026 15:10
@danilrwx danilrwx force-pushed the fix/vmop/migration-complete-message branch from 2de1e38 to aef956a Compare March 26, 2026 16:47
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
Signed-off-by: Daniil Antoshin <daniil.antoshin@flant.com>
@danilrwx danilrwx force-pushed the fix/vmop/migration-complete-message branch from 789581b to 6d098c7 Compare March 27, 2026 15:26
@danilrwx danilrwx merged commit 99a88cb into main Mar 27, 2026
28 of 30 checks passed
@danilrwx danilrwx deleted the fix/vmop/migration-complete-message branch March 27, 2026 15:39
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.

2 participants