Skip to content

Commit

Permalink
fix: extra-params on embedded resources
Browse files Browse the repository at this point in the history
Signed-off-by: mbwhite <whitemat@uk.ibm.com>
  • Loading branch information
mbwhite committed Jan 10, 2024
1 parent 9bb31e0 commit b92fd9a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 10 deletions.
20 changes: 18 additions & 2 deletions regression-tests/general/no-extra-param.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ metadata:
name: no-extra-param-template
spec:
resourcetemplates:
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pipeline-run-3
spec:
pipelineRef:
name: no-extra-param-pipeline
params:
- name: foo
value: foo
- name: notndeed
value: blank
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
Expand All @@ -41,25 +53,29 @@ spec:
params:
- name: foo
value: foo
- name: reallynotndeed
value: blank
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: pipeline-run-2
spec:
pipelineSpec:
params:
- name: reallyneeded
tasks:
- name: step-1
taskRef:
name: no-extra-param-task
params:
- name: foo
- name: unspecifified
value: foo
- name: step-2
taskSpec:
steps: []
params:
- name: foo
value: foo
value: $(params.readllyneeded)
params:
- name: extra-param-foo
value: foo
2 changes: 1 addition & 1 deletion regression-tests/general/no-extra-param.yaml.expect.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"message":"Pipeline 'no-extra-param-pipeline' references task 'no-extra-param-task' (as 'step-1'), and supplies parameter 'foo' to it, but it's not a valid parameter","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[291,322,322],"startLine":19,"startColumn":11,"endLine":21,"endColumn":1}},{"message":"Pipeline 'no-extra-param-pipeline' references task 'step-1', and supplies parameter 'foo' to it, but it's not a valid parameter","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[399,430,430],"startLine":25,"startColumn":11,"endLine":27,"endColumn":1}},{"message":"TriggerTemplate 'no-extra-param-template' references pipeline 'no-extra-param-pipeline', and supplies 'foo', but it's not a valid parameter.","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[758,791,791],"startLine":42,"startColumn":13,"endLine":44,"endColumn":1}}]
[{"message":"Pipeline 'no-extra-param-pipeline' references task 'no-extra-param-task' (as 'step-1'), and supplies parameter 'foo' to it, but it's not a valid parameter","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[291,322,322],"startLine":19,"startColumn":11,"endLine":21,"endColumn":1}},{"message":"Pipeline 'no-extra-param-pipeline' references task 'step-1', and supplies parameter 'foo' to it, but it's not a valid parameter","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[399,430,430],"startLine":25,"startColumn":11,"endLine":27,"endColumn":1}},{"message":"TriggerTemplate 'no-extra-param-template' references pipeline 'no-extra-param-pipeline', and supplies 'foo', but it's not a valid parameter.","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[758,791,791],"startLine":42,"startColumn":13,"endLine":44,"endColumn":1}},{"message":"TriggerTemplate 'no-extra-param-template' references pipeline 'no-extra-param-pipeline', and supplies 'notndeed', but it's not a valid parameter.","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[803,845,845],"startLine":44,"startColumn":13,"endLine":46,"endColumn":1}},{"message":"TriggerTemplate 'no-extra-param-template' references pipeline 'no-extra-param-pipeline', and supplies 'foo', but it's not a valid parameter.","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[1052,1085,1085],"startLine":54,"startColumn":13,"endLine":56,"endColumn":1}},{"message":"TriggerTemplate 'no-extra-param-template' references pipeline 'no-extra-param-pipeline', and supplies 'reallynotndeed', but it's not a valid parameter.","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[1097,1143,1143],"startLine":56,"startColumn":13,"endLine":58,"endColumn":1}},{"message":"TriggerTemplate 'no-extra-param-template' references pipeline 'pipeline-run-2', and supplies 'extra-param-foo', but it's not a valid parameter.","rule":"no-extra-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[1736,1781,1781],"startLine":80,"startColumn":13,"endLine":82,"endColumn":1}},{"message":"Undefined param 'readllyneeded' at .spec.resourcetemplates[2].spec.pipelineSpec.tasks[1].params[0].value in 'no-extra-param-template'","rule":"no-undefined-param","level":"error","path":"./regression-tests/general/no-extra-param.yaml","loc":{"range":[1684,1707,1708],"startLine":78,"startColumn":26,"endLine":78,"endColumn":49}}]
Loading

0 comments on commit b92fd9a

Please sign in to comment.