We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1. This bug can be reproduced using pure Argo YAML
If yes, it is more likely to be an Argo bug unrelated to Hera. Please double check before submitting an issue to Hera.
2. I have searched for existing issues
3. This bug occurs in Hera when...
Describe the bug Setting default values for workflow template's arguments doesn't work but is supported by Argo if specified directly in the YAML.
To Reproduce Full Hera code to reproduce the bug:
from hera.workflows import DAG, script, WorkflowTemplate, Parameter @script() def foo(a, b=42, c=None): print(a, b, c) with WorkflowTemplate( name="test-default-param", entrypoint="d", arguments=[ Parameter(name='a', default='1', description='This should have a default') ] ) as w: with DAG( name="d", inputs=[ Parameter(name='a', default='1') ]): foo(name="b-unset-c-unset", arguments={"a": "{{ inputs.parameters.a }}"})
generates
apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: name: test-default-param spec: arguments: parameters: - description: This should have a default name: a entrypoint: d templates: - dag: tasks: - arguments: parameters: - name: a value: '{{ inputs.parameters.a }}' name: b-unset-c-unset template: foo inputs: parameters: - default: '1' name: a name: d - inputs: parameters: - name: a - default: '42' name: b - default: 'null' name: c name: foo script: command: - python image: python:3.8 source: |- import os import sys sys.path.append(os.getcwd()) import json try: a = json.loads(r'''{{inputs.parameters.a}}''') except: a = r'''{{inputs.parameters.a}}''' try: b = json.loads(r'''{{inputs.parameters.b}}''') except: b = r'''{{inputs.parameters.b}}''' try: c = json.loads(r'''{{inputs.parameters.c}}''') except: c = r'''{{inputs.parameters.c}}''' print(a, b, c)
The default value is not present in the UI:
Expected behavior The generated YAML contains default values:
apiVersion: argoproj.io/v1alpha1 kind: WorkflowTemplate metadata: name: test-default-param spec: arguments: parameters: - description: This should have a default default: '1' name: a entrypoint: d templates: - dag: tasks: - arguments: parameters: - name: a value: '{{ inputs.parameters.a }}' name: b-unset-c-unset template: foo inputs: parameters: - default: '1' name: a name: d - inputs: parameters: - name: a - default: '42' name: b - default: 'null' name: c name: foo script: command: - python image: python:3.8 source: |- import os import sys sys.path.append(os.getcwd()) import json try: a = json.loads(r'''{{inputs.parameters.a}}''') except: a = r'''{{inputs.parameters.a}}''' try: b = json.loads(r'''{{inputs.parameters.b}}''') except: b = r'''{{inputs.parameters.b}}''' try: c = json.loads(r'''{{inputs.parameters.c}}''') except: c = r'''{{inputs.parameters.c}}''' print(a, b, c)
and the default value is set in Argo UI
Environment
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Pre-bug-report checklist
1. This bug can be reproduced using pure Argo YAML
If yes, it is more likely to be an Argo bug unrelated to Hera. Please double check before submitting an issue to Hera.
2. I have searched for existing issues
3. This bug occurs in Hera when...
Bug report
Describe the bug
Setting default values for workflow template's arguments doesn't work but is supported by Argo if specified directly in the YAML.
To Reproduce
Full Hera code to reproduce the bug:
generates
The default value is not present in the UI:
Expected behavior
The generated YAML contains default values:
and the default value is set in Argo UI
Environment
The text was updated successfully, but these errors were encountered: