Pipeline: Task may have uninterpolated variables in BuildSpec

Created on 1 Nov 2018  路  6Comments  路  Source: tektoncd/pipeline

Expected Behavior

A Task would fail validation if it tries to define a BuildSpec that has variables which would not be interpolated due to missing inputs or outputs. Having this error on validation would shorten the loop when trying to write a Pipeline as errors with Tasks would be caught much sooner.

Actual Behavior

The Task will create the Build with the uninterpolated variable

Steps to Reproduce the Problem

  1. Add a variable ${inputs.params.thisdoesnotexist} to part of a BuildSpec
good first issue help wanted

All 6 comments

Good call, thanks for opening this @tanner-bruce !

So, if I'm understanding correctly (which is always an open question!), this would entail traversing the BuildSpec to find any fields in it that have ${input.params.whatever} and erroring for any cases where whatever isn't a defined parameter?

@abayer Yup. I wrote a quick PoC in pkg/apis/pipeline/v1alpha1/task_validation.go last night doing exactly that. I'm going to clean it up later tonight and make a PR.

${inputs.resources.whatever} also needs to be considered

/assign tanner-bruce

@tanner-bruce - gotcha! Will watch for your PR and won't bother trying to do it myself. =)

@tanner-bruce - just checking if you're still going to open that PR - I'm trying to find a small chunk of work to use as my first code contribution and wanna make sure this isn't a good option. =)

/assign

@tanner-bruce as you didn't open a PR and it staled I took a bit at it :angel:

Was this page helpful?
0 / 5 - 0 ratings