From 72a30701ccdcbddae1e5b1d84726f1b4b383b49f Mon Sep 17 00:00:00 2001 From: Luca Miccini Date: Wed, 20 Nov 2024 08:45:01 +0100 Subject: [PATCH] Fix memcached selector and labels --- pkg/memcached/service.go | 2 ++ pkg/memcached/statefulset.go | 1 + 2 files changed, 3 insertions(+) diff --git a/pkg/memcached/service.go b/pkg/memcached/service.go index 4f5958d2..3d76650b 100644 --- a/pkg/memcached/service.go +++ b/pkg/memcached/service.go @@ -11,6 +11,7 @@ import ( // HeadlessService exposes all memcached repliscas for a memcached CR func HeadlessService(m *memcachedv1.Memcached) *corev1.Service { labels := labels.GetLabels(m, "memcached", map[string]string{ + "app": m.GetName(), common.OwnerSelector: "infra-operator", "cr": m.GetName(), common.AppSelector: m.GetName(), @@ -21,6 +22,7 @@ func HeadlessService(m *memcachedv1.Memcached) *corev1.Service { Labels: labels, Selector: map[string]string{ common.AppSelector: m.GetName(), + "app": m.GetName(), }, Ports: []corev1.ServicePort{ {Name: "memcached", Protocol: "TCP", Port: MemcachedPort}, diff --git a/pkg/memcached/statefulset.go b/pkg/memcached/statefulset.go index 7635cb24..0be2ac75 100644 --- a/pkg/memcached/statefulset.go +++ b/pkg/memcached/statefulset.go @@ -17,6 +17,7 @@ func StatefulSet( configHash string, ) *appsv1.StatefulSet { matchls := map[string]string{ + "app": m.Name, common.AppSelector: m.Name, "cr": m.Name, common.OwnerSelector: "infra-operator",