From e735f78e58c6f31ed34bbbaeaf2e545cc8969522 Mon Sep 17 00:00:00 2001 From: pb Date: Tue, 15 Jul 2025 14:58:19 +0200 Subject: [PATCH] added a new method to create kubernetes names with the same naming --- entrypoint.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/entrypoint.go b/entrypoint.go index 7429ffa..7dc00ba 100644 --- a/entrypoint.go +++ b/entrypoint.go @@ -597,3 +597,15 @@ func (l *LibData) ToPurchasedResource() *purchase_resource.PurchaseResource { } return nil } + + +// ============== ADMIRALTY ============== +// 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 +} \ No newline at end of file