From 53043e7781219327b930128b735ac7a7892f5a8b Mon Sep 17 00:00:00 2001 From: pb Date: Mon, 28 Jul 2025 11:45:36 +0200 Subject: [PATCH] removed the label in Target --- infrastructure/kubernetes.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/infrastructure/kubernetes.go b/infrastructure/kubernetes.go index 02c4831..3478553 100644 --- a/infrastructure/kubernetes.go +++ b/infrastructure/kubernetes.go @@ -324,9 +324,9 @@ func (k *KubernetesService) CreateAdmiraltyTarget(context context.Context, execu "metadata": map[string]interface{}{ "name": targetName, "namespace": executionId, - "labels": map[string]interface{}{ - "peer": peerId, - }, + // "labels": map[string]interface{}{ + // "peer": peerId, + // }, }, "spec": map[string]interface{}{ "kubeconfigSecret": map[string]string{ @@ -608,3 +608,12 @@ func (k *KubernetesService) CreateSecret(context context.Context, minioId string return nil } +// Returns a concatenation of the peerId and namespace in order for +// kubernetes ressources to have a unique name, under 63 characters +// and yet identify which peer they are created for +func getConcatenatedName(peerId string, namespace string) string { + s := strings.Split(namespace, "-")[:2] + n := s[0] + "-" + s[1] + + return peerId + "-" + n +}