英文:
How do I use templateDefaults with templates in an argo workslows WorkflowTemplate
问题
I'd like to use the templateDefaults feature to share common environment variables & images between a set of script templates defined in a WorkflowTemplate resource, something like this;
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
spec:
templateDefaults:
script:
image: someimage:v1.2.3
templates:
- name: foo
script:
name: 'foo'
...
- name: bar
script:
name: 'bar'
...
this does not work for me when i reference the template in another workflow - the templateDefaults
seem to get ignored & i get an error that the script image is not defined.
Is there an alternative way to accomplish this?
英文:
I'd like to use the templateDefaults feature to share common environment variables & images between a set of script templates defined in a WorkflowTemplate resource, something like this;
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
spec:
templateDefaults:
script:
image: someimage:v1.2.3
templates:
- name: foo
script:
name: 'foo'
...
- name: bar
script:
name: 'bar'
...
this does not work for me when i reference the template in another workflow - the templateDefaults
seem to get ignored & i get an error that the script image is not defined.
Is there an alternative way to accomplish this?
答案1
得分: 0
如在此 Ticket 中所述:
templateDefault
在templateRef
场景中不起作用。因为templateRef
只是引用模板,而不是整个workflowSpec
在workflowtemplate
中。您必须将templateDefault
移动到调用者(Workflow)的规范中。
英文:
As stated in this Ticket:
> templatedefault will not work in templateRef scenario. Because templateRef is just referring the template not the entire workflowSpec in workflowtemplate. you have to move the templateDefault to caller (Workflow) spec.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论