Skip to content

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

Open
danilrwx wants to merge 4 commits intomainfrom
fix/vmop/migration-complete-message
Open

fix(core): run firmware upgrade migration only for running vmi#2162
danilrwx wants to merge 4 commits intomainfrom
fix/vmop/migration-complete-message

Conversation

@danilrwx
Copy link
Contributor

@danilrwx danilrwx commented Mar 26, 2026

Description

Improve workload-updater migration behavior for firmware updates and increase unit-test coverage for handler decision branches.

Functional change

FirmwareHandler now handles KVVMI read outcomes explicitly:

  • if Get(KVVMI) returns NotFound, processing continues;
  • if Get(KVVMI) returns any other error, handler returns error;
  • if KVVMI exists but status.phase != Running, migration is not triggered.

Test changes

Extended branch coverage for:

  • pkg/controller/workload-updater/internal/handler/firmware.go
  • pkg/controller/workload-updater/internal/handler/nodeplacement.go

Coverage after changes (go test ./pkg/controller/workload-updater/internal/handler/... -coverprofile=/tmp/wu-handler.cover):

  • firmware.go — 100% per function (Handle, needUpdate, isVirtControllerUpToDate, getVirtLauncherImage, Name)
  • nodeplacement.goHandle 94.1%, Name 100%, genNodePlacementSum 90.0%
  • package total handler — 90.5%

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

Previously, firmware updater could create firmware-update-* VMOP while VMI was not running (Pending/Succeeded). This produced unnecessary failed migration VMOPs and misleading operation status.

Also, KVVMI absence should not block processing when all other preconditions are satisfied.

Additional tests reduce regression risk in workload-updater branching logic.

What is the expected result?

  1. VM has FirmwareUpToDate=False.
  2. If KVVMI exists and is not Running, firmware updater does not create firmware-update-* VMOP.
  3. If KVVMI is missing (NotFound) and other conditions are met, migration flow continues.
  4. If KVVMI Get returns non-NotFound error, handler returns error.

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: "Run firmware workload-update migration only for running virtual machine instances, continue on missing KVVMI, and avoid unnecessary failed VMOPs for non-running VMs."
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
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 2de1e38 to aef956a Compare March 26, 2026 16:47
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