From 4952f97342ac1260ee2dd3436d3a98e3067689a6 Mon Sep 17 00:00:00 2001 From: catttam Date: Fri, 22 Nov 2024 08:58:25 +0100 Subject: [PATCH] Minor change on jobs UUID generation --- pkg/handlers/job.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/handlers/job.go b/pkg/handlers/job.go index 73668e12..f74582b3 100644 --- a/pkg/handlers/job.go +++ b/pkg/handlers/job.go @@ -178,8 +178,14 @@ func MakeJobHandler(cfg *types.Config, kubeClientset *kubernetes.Clientset, back } // Make JOB_UUID envVar + serviceNameLenght := len(service.Name) + serviceName := service.Name jobUUID := uuid.New().String() - jobUUID = service.Name + "-" + jobUUID + + if serviceNameLenght >= 25 { + serviceName = serviceName[:16] + } + jobUUID = serviceName + "-" + jobUUID jobUUIDVar := v1.EnvVar{ Name: types.JobUUIDVariable, Value: jobUUID,