Skip to content

Allow variable substitution in pipeline.tasks[].onError #8564

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

Closed
dmitry-mightydevops opened this issue Feb 12, 2025 · 4 comments · Fixed by #8600
Closed

Allow variable substitution in pipeline.tasks[].onError #8564

dmitry-mightydevops opened this issue Feb 12, 2025 · 4 comments · Fixed by #8600
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@dmitry-mightydevops
Copy link

Feature request

This doc says that only CRD Task accept variable substitution for spec.steps[].onError

It woulod be nice to support same behavior in pipeline.tasks[].onError

Use case

pipeline: 
tasks:
  - name: test
    onError: $(params.deploy_if_tests_failed)

So for example I want a flexible control if I need to continue (or stop) the pipeline if tests failed passed via params.

For now It fails with the error:

Resource: "tekton.dev/v1, Resource=pipelines", GroupVersionKind: "tekton.dev/v1, Kind=Pipeline"
Name: "backend-build-pipeline", Namespace: "ci"
for: "STDIN": error when patching "STDIN": admission webhook "validation.webhook.pipeline.tekton.dev" denied the request: validation failed: invalid value: $(params.deploy.deploy_if_tests_failed): spec.tasks[10].OnError
PipelineTask OnError must be either "continue" or "stopAndFail"
@dmitry-mightydevops dmitry-mightydevops added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 12, 2025
@l-qing
Copy link
Member

l-qing commented Feb 21, 2025

I also think this demand is reasonable.
Since steps can be set, should tasks also be supported without any side effects? @vdemeester

@vdemeester
Copy link
Member

Hum, I do think this demand is reasonable indeed. I don't see why not implementing it, and I don't think it would have any bad side effect.

@afrittoli
Copy link
Member

@dmitry-mightydevops and @l-qing - would either of you be interested in contributing the implementation for this?

@l-qing
Copy link
Member

l-qing commented Feb 27, 2025

@dmitry-mightydevops and @l-qing - would either of you be interested in contributing the implementation for this?

I'll give it a try this weekend.

/assign

l-qing added a commit to l-qing/pipeline that referenced this issue Feb 27, 2025
fix tektoncd#8564

In the reconcile logic of PipelineRun, add the ability to replace the
`pipeline.tasks[].onError` field. At the same time, the validation of
pipelineSpec legality has been delayed.
l-qing added a commit to l-qing/pipeline that referenced this issue Feb 27, 2025
fix tektoncd#8564

In the reconcile logic of PipelineRun, add the ability to replace the
`pipeline.tasks[].onError` field. At the same time, the validation of
pipelineSpec legality has been delayed.
l-qing added a commit to l-qing/pipeline that referenced this issue Mar 12, 2025
fix tektoncd#8564

In the reconcile logic of PipelineRun, add the ability to replace the
`pipeline.tasks[].onError` field. At the same time, the validation of
pipelineSpec legality has been delayed.
l-qing added a commit to l-qing/pipeline that referenced this issue Mar 14, 2025
fix tektoncd#8564

In the reconcile logic of PipelineRun, add the ability to replace the
`pipeline.tasks[].onError` field. At the same time, the validation of
pipelineSpec legality has been delayed.
tekton-robot pushed a commit that referenced this issue Apr 7, 2025
fix #8564

In the reconcile logic of PipelineRun, add the ability to replace the
`pipeline.tasks[].onError` field. At the same time, the validation of
pipelineSpec legality has been delayed.
@github-project-automation github-project-automation bot moved this from Todo to Done in Tekton Community Roadmap Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants