argoproj / argo-workflows

Workflow Engine for Kubernetes
https://argo-workflows.readthedocs.io/
Apache License 2.0
14.96k stars 3.19k forks source link

generateName with customized suffix length #6807

Open treeguard opened 3 years ago

treeguard commented 3 years ago

Summary

Currently the workflows generated by workflowTemplate where the generateName is defined will have a suffix which is a random string of length 5, see https://github.com/argoproj/argo-workflows/blob/e5b131a333afac0ed3444b70e2fe846b86dc63e1/workflow/util/util.go#L613 this has brought up workflow name conflicts in our use case. It would be great if the length of the random string can be customized.

What change needs making? Add one more parameter in the workflow definition, for example, generateNameSuffixLength so that it can be customized.

Use Cases

When would you use this?

ASAP, we are now trying to override the name field when submitting the workflow as a workaround now.


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.

tooptoop4 commented 1 year ago

@treeguard how do u handle this for cronworkflows?

LinuxSuRen commented 1 year ago

I'm wondering if it's ok to let Kubernetes generate the name. I mean just provide the generateName instead of the name field.

tooptoop4 commented 1 year ago

@LinuxSuRen generateName only provides 5 random characters which is not unique, we facing collisions

LinuxSuRen commented 1 year ago

@LinuxSuRen generateName only provides 5 random characters which is not unique, we facing collisions

That is the limit of Argo workflow. I'm talking about letting Kubernetes to generate it.