From 5f4c9c1e2c24b185ddb28436414388c1625e0bd9 Mon Sep 17 00:00:00 2001 From: Fabian Kramm Date: Thu, 19 Dec 2024 09:53:19 +0100 Subject: [PATCH] fix: service label sync problems (#2353) (cherry picked from commit ecc7bcf65c9d24aacc5bf6235cea6c6c5192a559) --- pkg/controllers/resources/services/syncer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/resources/services/syncer.go b/pkg/controllers/resources/services/syncer.go index 0bebcd9a8..340f9de03 100644 --- a/pkg/controllers/resources/services/syncer.go +++ b/pkg/controllers/resources/services/syncer.go @@ -204,7 +204,7 @@ func (s *serviceSyncer) Sync(ctx *synccontext.SyncContext, event *synccontext.Sy // translate selector // TODO: ryan - convert to bidirectional - if !apiequality.Semantic.DeepEqual(event.VirtualOld.Spec.Selector, event.Virtual.Spec.Selector) { + if !apiequality.Semantic.DeepEqual(event.VirtualOld.Spec.Selector, event.Virtual.Spec.Selector) || apiequality.Semantic.DeepEqual(event.HostOld.Spec.Selector, event.Host.Spec.Selector) { event.Host.Spec.Selector = translate.HostLabelsMap(event.Virtual.Spec.Selector, event.Host.Spec.Selector, event.Virtual.Namespace, false) } else { event.Virtual.Spec.Selector = translate.VirtualLabelsMap(event.Host.Spec.Selector, event.Virtual.Spec.Selector)