From 9441f552df66db5f5cd39a6dc5a8b1a351e216f3 Mon Sep 17 00:00:00 2001 From: Martin Necas Date: Tue, 14 Jan 2025 15:28:52 +0100 Subject: [PATCH] MTV-1613 | Remove vm preference Signed-off-by: Martin Necas --- pkg/controller/plan/kubevirt.go | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/pkg/controller/plan/kubevirt.go b/pkg/controller/plan/kubevirt.go index 06cb04e87..665970df2 100644 --- a/pkg/controller/plan/kubevirt.go +++ b/pkg/controller/plan/kubevirt.go @@ -1311,20 +1311,17 @@ func (r *KubeVirt) virtualMachine(vm *plan.VMStatus) (object *cnv.VirtualMachine } var ok bool - object, err = r.vmPreference(vm) - if err != nil { - r.Log.Info("Building VirtualMachine without a VirtualMachinePreference.", + r.Log.Info("Building VirtualMachine without a VirtualMachinePreference.", + "vm", + vm.String(), + "err", + err) + object, ok = r.vmTemplate(vm) + if !ok { + r.Log.Info("Building VirtualMachine without template.", "vm", - vm.String(), - "err", - err) - object, ok = r.vmTemplate(vm) - if !ok { - r.Log.Info("Building VirtualMachine without template.", - "vm", - vm.String()) - object = r.emptyVm(vm) - } + vm.String()) + object = r.emptyVm(vm) } err = r.setInstanceType(vm, object)