Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generateName or name should allow variables in their definition #7900

Open
tooptoop4 opened this issue Feb 17, 2022 · 8 comments
Open

generateName or name should allow variables in their definition #7900

tooptoop4 opened this issue Feb 17, 2022 · 8 comments
Labels
area/spec Changes to the workflow specification. area/templating Templating with `{{...}}` solution/workaround There's a workaround, might not be great, but exists type/feature Feature request

Comments

@tooptoop4
Copy link
Contributor

tooptoop4 commented Feb 17, 2022

if I try some variable within these values they complain about { is not a valid alphanumeric

@tooptoop4 tooptoop4 added the type/feature Feature request label Feb 17, 2022
@terrytangyuan
Copy link
Member

I don’t think you can substitute these.

@alexec alexec added the area/spec Changes to the workflow specification. label Feb 17, 2022
@alexec
Copy link
Contributor

alexec commented Feb 17, 2022

This is not possible when submiting a Workflow directly, because the name must be know at submission time.

But what about WorkflowTemplate? We could do something like this:

kind: WorkflowTemplate
spec:
  workflowMetadata:
    name: 
     valueFrom: 
       expression: "my-expression"

@tooptoop4
Copy link
Contributor Author

@alexec does your example work in released version or is it a proposal?

@alexec
Copy link
Contributor

alexec commented Feb 18, 2022

It is proposal.

@tooptoop4
Copy link
Contributor Author

any workarounds? as workflow that runs often is getting name collisions so it can't be archived

@raven-wing
Copy link

raven-wing commented Mar 15, 2023

there is workaround:

            - src:
                dependencyName: test-dep
                dataTemplate: "{{ .Input.body.pull_request.number }}-{{ .Input.body.pull_request.head.sha | substr 0 7 }}"
              dest: metadata.name

from here

@tooptoop4
Copy link
Contributor Author

@raven-wing that is only for argo-events objects?

@agilgur5 agilgur5 added the area/templating Templating with `{{...}}` label Oct 16, 2024
@agilgur5 agilgur5 changed the title metadata.generateName or metadata.name should allow variables in their definition generateName or name should allow variables in their definition Oct 18, 2024
@agilgur5 agilgur5 added the solution/workaround There's a workaround, might not be great, but exists label Oct 18, 2024
@agilgur5
Copy link
Member

there is workaround:

You can also use the Workflow of Workflows pattern with a wrapper Workflow to do something similar.
That's potentially the easiest way to do it with Argo Workflows alone (i.e. without Events etc).

Otherwise this isn't possible to do directly, as mentioned above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/spec Changes to the workflow specification. area/templating Templating with `{{...}}` solution/workaround There's a workaround, might not be great, but exists type/feature Feature request
Projects
None yet
Development

No branches or pull requests

5 participants