-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
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
If I pass something that can be interpreted as a variable on a task input it will break the task with a non-existent variable error #4690
Comments
/assign @Aleromerog |
After some attempts of not evaluating strings inside quotes, we realized there may be cases when a user would want variables inside quotes to be treated as variables. So there are a couple of options for this:
Maybe option 1 is a quick and easy fix, but I'd like to have some feedback on this. |
For me, the easiest fix would be to not validate (nor interpolate) things in |
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
I've addressed this bug for TaskRuns, but it still needs to be addressed for PipelineRuns. Here's an example PipelineRun where this error appears:
|
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in #4690.
This commit removes validation for fields containing a parameter variable after the parameter value has already been substituted in TaskRun and PipelineRun. This is done to allow parameter values to contain literal strings like $(params.a); for example, in tektoncd#4690.
Merged a PR for this. |
Thanks @Aleromerog! |
I was able to reproduce this bug on main. It looks like it was reintroduced by #4891 |
Issues go stale after 90d of inactivity. /lifecycle stale Send feedback to tektoncd/plumbing. |
Stale issues rot after 30d of inactivity. /lifecycle rotten Send feedback to tektoncd/plumbing. |
Rotten issues close after 30d of inactivity. /close Send feedback to tektoncd/plumbing. |
@tekton-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Expected Behavior
print the literal
{"key": "$(params.a)"}
Actual Behavior
CouldntGetTask error
failed to create task run pod "some-task-run-2": non-existent variable in "echo {\"key\": \"$(params.a)\"}\n": steps[0].script. Maybe missing or invalid Task my-ns/some-task
Steps to Reproduce the Problem
I ran into this problem trying to pass a TaskRun cloud event payload as a param to another Task. For now, I have a workaround using CEL on the EventListener to replace every
$(params.
for an empty string like soThis works fine for me now but I see some unexpected behaviors happening in the future, so it would be nice if the task could escape or not try to interpret the values on the params.
Additional Info
Kubernetes version:
Output of
kubectl version
:The text was updated successfully, but these errors were encountered: