Skip to content

[release-2.11] MTV-4413 | Skip context-dependent validations when maps are missing#4728

Merged
yaacov merged 1 commit intorelease-2.11from
bp-release-2.11-2a7a108
Feb 12, 2026
Merged

[release-2.11] MTV-4413 | Skip context-dependent validations when maps are missing#4728
yaacov merged 1 commit intorelease-2.11from
bp-release-2.11-2a7a108

Conversation

@github-actions
Copy link

@github-actions github-actions bot commented Feb 9, 2026

Backport: #4725

Issue:
When a NetworkMap or StorageMap referenced by a Plan is deleted, validateNetworkMap/validateStorageMap correctly set Critical conditions but plancontext.New() then fails because Referenced.Map is nil. This hard error prevents updatePlanStatus() from ever being called, so the conditions are never persisted and the controller fails.

Fix:
Add an early return in validate() after map validations when blocker conditions are already present. This lets the reconcile flow continue, reconcile will also check HasBlockerCondition() and skips execution, and the user sees a "not ready" status on the Plan instead of controller crash.

Example:

Create a plan and delete the network map:

oc mtv create plan plan-rhel9 -S vmware-provider  --vms Ameen-win2022
oc delete networkmap plan-rhel9-network-map

Without fix:

oc logs -n openshift-mtv deployments/forklift-controller | jq 'select(.level == "error")'
Defaulted container "main" out of: main, inventory
{
  "level": "error",
  "ts": "2026-02-09 09:50:57.989",
  "logger": "plan|ds9qd",
  "msg": "Reconcile failed.",
  "plan": {
    "name": "plan-rhel9",
    "namespace": "demo"
  },
  "error": "Not enough data to build plan context.",
  "stacktrace": "github.com/kubev2v/forklift/pkg/controller/base.(*Reconciler).Ended
\t/app/pkg/controller/base/controller.go:64
github.com/kubev2v/forklift/pkg/controller/plan.Reconciler.Reconcile.func1
\t/app/pkg/controller/plan/controller.go:177
github.com/kubev2v/forklift/pkg/controller/plan.Reconciler.Reconcile
\t/app/pkg/controller/plan/controller.go:234
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile
\t/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:119
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler
\t/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:334
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem
\t/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:294
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2
\t/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:255"
}

with fix:

oc logs -n openshift-mtv deployments/forklift-controller | jq 'select(.level == "error")'
Defaulted container "main" out of: main, inventory

Ref: https://issues.redhat.com/browse/MTV-4413
Resolves: MTV-4413

Issue:
When a NetworkMap or StorageMap referenced by a Plan is deleted,
validateNetworkMap/validateStorageMap correctly set Critical conditions
but plancontext.New() then fails because Referenced.Map is nil. This
hard error prevents updatePlanStatus() from ever being called, so the
conditions are never persisted and the controller fails.

Fix:
Add an early return in validate() after map validations when blocker
conditions are already present. This lets the reconcile flow continue,
reconcile will also check HasBlockerCondition() and skips execution,
and the user sees a "not ready" status on the Plan instead of controller crash.

Ref: https://issues.redhat.com/browse/MTV-4413
Resolves: MTV-4413

Signed-off-by: yaacov <yzamir@redhat.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

@yaacov yaacov merged commit 0ac6fe5 into release-2.11 Feb 12, 2026
11 checks passed
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

Comments