Checklist:
What happened:
Ran argo lint on a WorkflowTemplate with syntax errors and they weren't caught. If the kind is changed to Workflow then the syntax errors are caught.
What you expected to happen:
The syntax errors to be caught.
How to reproduce it (as minimally and precisely as possible):
Call argo lint with this WorkflowTemplate. Note the purposeful misspelling of parameters
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: workflow-template-submittable
spec:
entrypoint: whalesay-template # Fields other than "arguments" and "templates" not supported in v2.4 - v2.6
arguments:
parmeters:
- name: message
value: hello world
templates:
- name: whalesay-template
inputs:
parmeters:
- name: message
container:
image: docker/whalesay
command: [cowsay]
args: ['{{inputs.parameters.message}}']
Anything else we need to know?:
Environment:
v2.7.7
v1.14.10
Other debugging information (if applicable):
argo lint test_workflow_template.yaml
WARN[0000] WorkflowTemplate is not a workflow
test_workflow_template.yaml is valid
Workflow manifests validated
Message from the maintainers:
If you are impacted by this bug please add a 馃憤 reaction to this issue! We often sort issues this way to know what to prioritize.
@dtaniwaki ?
argo workflowtemplate lint instead?
I'll own this
@dan-katz As @dtaniwaki correctly pointed out, WorkflowTemplates should be linted with
$ argo template lint <FILE_NAME>
When I ran this, the lint returned an error as expected:
$ argo template lint t.yaml
ERRO[0000] t.yaml failed to parse: error unmarshaling JSON: while decoding JSON: json: unknown field "parmeters"
However, the command still exits 0 and not 1 when this is the case. Furhermore, when incorrectly linting with argo lint:
$ argo lint t.yaml
WARN[0000] WorkflowTemplate is not a workflow
t.yaml is valid
Workflow manifests validated
A warning is issued correctly, but a Workflow manifests validated message is still returned, which is incorrect since nothing was validated. I'll fix this.
Thank you for the quick responses!
Most helpful comment
@dan-katz As @dtaniwaki correctly pointed out,
WorkflowTemplatesshould be linted withWhen I ran this, the lint returned an error as expected:
However, the command still exits
0and not1when this is the case. Furhermore, when incorrectly linting withargo lint:A warning is issued correctly, but a
Workflow manifests validatedmessage is still returned, which is incorrect since nothing was validated. I'll fix this.