From 2899729c0bf8b4ee3d7fe5d19fe739b4b29debec Mon Sep 17 00:00:00 2001 From: inovindasari Date: Wed, 4 Dec 2024 17:04:07 +0100 Subject: [PATCH] should compare label for service and update --- e2e/tests/constants.py | 2 +- pkg/cluster/cluster.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/tests/constants.py b/e2e/tests/constants.py index 5c3a64d6d..dea17438e 100644 --- a/e2e/tests/constants.py +++ b/e2e/tests/constants.py @@ -1,4 +1,4 @@ -LEADER_LABEL_VALUE = "master" # master or primary +LEADER_LABEL_VALUE = "master" # value should be the same as in the configmap: pod_leader_label_value SPILO_CURRENT = "registry.opensource.zalan.do/acid/spilo-16-e2e:0.1" SPILO_LAZY = "registry.opensource.zalan.do/acid/spilo-16-e2e:0.2" SPILO_FULL_IMAGE = "ghcr.io/zalando/spilo-16:3.2-p3" diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index dc1108139..67548333f 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -837,6 +837,10 @@ func (c *Cluster) compareServices(old, new *v1.Service) (bool, string) { } } + if !reflect.DeepEqual(old.Labels, new.Labels) { + return false, "new service's labels do not match the current ones" + } + if !reflect.DeepEqual(old.ObjectMeta.OwnerReferences, new.ObjectMeta.OwnerReferences) { return false, "new service's owner references do not match the current ones" }