pipeline: Conditionals: Configure what happens when a task is skipped due to condition failure
Expected Behavior
Users can decide to either run or skip tasks that are dependent on the task that was skipped due to a condition check failure.
Actual Behavior
Tasks that are dependent on a skipped task are always skipped
Steps to Reproduce the Problem
- Create a pipeline like similar to this:
apiVersion: tekton.dev/v1alpha1
kind: Pipeline
metadata:
name: two-tasks-one-condition
spec:
tasks:
- name: conditional-task
taskRef:
name: task1
conditions:
- conditionRef: always-fail
- name: run-if-1-or-1-skipped
taskRef:
name: task2
runAfter:
- conditional-task
- Run the pipeline through a PipelineRun
- task2 is not executed
Additional Info
- Might be worth enumerating the use cases for this feature before implementing this.
- Based on discussion from #27: https://docs.google.com/a/google.com/document/d/1iTb0rDDlgQcPbiYIGJ-atkaML8aCyPCyhfucCPJmNLs/edit?disco=AAAADD1TnxU
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 10
- Comments: 24 (10 by maintainers)
@Bl4d3s we paused that work for a bit as we discussed some design choices and alternatives in https://github.com/tektoncd/pipeline/issues/3345 – rebasing the pr now ~and planning to get it in before the v0.18 release~ (revisited syntax in https://github.com/tektoncd/community/pull/258)
@jerop I really could use the feature you implemented in the PR. is there any ETA when this will be merged? If I can help with anything to speed things up, I can always take a look.
My use case:
One thought after looking at #1137 :
froma Task that has a failing condition, I’m not sure it makes any sense to run that dependent Task: e.g. if a Task is building an image as an output, and another task wants to get the built image (digest)fromthat Task, it wouldn’t make sense to run it anywayrunAfteris fuzzier - if it’s just a matter of ordering, it feels like the user could potentially choose whether the tasks “after” should be skipped or not