From d8a4fc8d433db7f3fb8b870947c3b5139580dcea Mon Sep 17 00:00:00 2001 From: yaroslavborbat Date: Thu, 5 Dec 2024 19:16:25 +0300 Subject: [PATCH] fix vmclass watcher Signed-off-by: yaroslavborbat --- .../pkg/controller/vm/internal/watcher/vmclass_watcher.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/images/virtualization-artifact/pkg/controller/vm/internal/watcher/vmclass_watcher.go b/images/virtualization-artifact/pkg/controller/vm/internal/watcher/vmclass_watcher.go index 48a7bb9f0..aeb792378 100644 --- a/images/virtualization-artifact/pkg/controller/vm/internal/watcher/vmclass_watcher.go +++ b/images/virtualization-artifact/pkg/controller/vm/internal/watcher/vmclass_watcher.go @@ -18,8 +18,8 @@ package watcher import ( "context" - "reflect" + "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" @@ -79,7 +79,9 @@ func (w VirtualMachineClassWatcher) Watch(mgr manager.Manager, ctr controller.Co if !oldOk || !newOk { return false } - return !reflect.DeepEqual(oldVMC.Spec.SizingPolicies, newVMC.Spec.SizingPolicies) + return !equality.Semantic.DeepEqual(oldVMC.Spec.SizingPolicies, newVMC.Spec.SizingPolicies) || + !equality.Semantic.DeepEqual(oldVMC.Spec.Tolerations, oldVMC.Spec.Tolerations) || + !equality.Semantic.DeepEqual(oldVMC.Spec.NodeSelector, newVMC.Spec.NodeSelector) }, }, )