use 5 last chars of uuid

This commit is contained in:
pat-s
2025-01-07 09:06:07 +01:00
parent 849665d13d
commit 5bcb00ffc3
3 changed files with 3 additions and 3 deletions

View File

@@ -70,7 +70,7 @@ func (e *docker) toConfig(step *types.Step, options BackendOptions) *container.C
}
func toContainerName(step *types.Step, workflowName string) string {
return "wp_" + workflowName + "-" + step.Name + "-" + step.UUID[:5]
return "wp_" + workflowName + "-" + step.Name + "-" + step.UUID[len(step.UUID)-5:]
}
// returns a container host configuration.

View File

@@ -77,7 +77,7 @@ func stepToPodName(step *types.Step, workflowName string) (name string, err erro
}
func podName(step *types.Step, workflowName string) (string, error) {
return dnsName(podPrefix + workflowName + "-" + step.Name + "-" + step.UUID[:5])
return dnsName(podPrefix + workflowName + "-" + step.Name + "-" + step.UUID[len(step.UUID)-5:])
}
func podMeta(step *types.Step, config *config, options BackendOptions, podName, workflowName string) (meta_v1.ObjectMeta, error) {

View File

@@ -63,7 +63,7 @@ func mkService(step *types.Step, config *config, workflowName string) (*v1.Servi
}
func serviceName(step *types.Step, workflowName string) (string, error) {
return dnsName(servicePrefix + workflowName + "-" + step.Name + "-" + step.UUID[:5])
return dnsName(servicePrefix + workflowName + "-" + step.Name + "-" + step.UUID[len(step.UUID)-5:])
}
func servicePort(port types.Port) v1.ServicePort {