Skip to content

Commit

Permalink
Minor change on jobs UUID generation
Browse files Browse the repository at this point in the history
  • Loading branch information
catttam committed Nov 22, 2024
1 parent c2036fd commit 4952f97
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/handlers/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4952f97

Please sign in to comment.