From 1d23fde352313116841e7c1b3989d54365a65ea8 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Mon, 4 Nov 2024 14:31:46 +0100 Subject: [PATCH] Revert --- pkg/tags/tagUtils.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/tags/tagUtils.go b/pkg/tags/tagUtils.go index 5e6793f..81bc8e3 100644 --- a/pkg/tags/tagUtils.go +++ b/pkg/tags/tagUtils.go @@ -17,8 +17,14 @@ func BuildClusterServiceFQNTag(clusterID string, namespace, serviceName string) // // cluster.metal-stack.io/id/namespace/service=/namespace/servicename func IsMemberOfCluster(tag, clusterID string) bool { - if strings.HasPrefix(tag, t.ClusterID) && strings.Contains(tag, "="+clusterID+"/") { - return true + if strings.HasPrefix(tag, t.ClusterID) { + parts := strings.Split(tag, "=") + if len(parts) != 2 { + return false + } + if strings.HasPrefix(parts[1], clusterID) { + return true + } } return false }