Skip to content

Commit

Permalink
Add always-true condition for easy testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyom committed Jul 1, 2019
1 parent 6c7accb commit c7c5f5d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/200-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rules:
resources: ["mutatingwebhookconfigurations"]
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
- apiGroups: ["tekton.dev"]
resources: ["tasks", "clustertasks", "taskruns", "pipelines", "pipelineruns", "pipelineresources"]
resources: ["tasks", "clustertasks", "taskruns", "pipelines", "pipelineruns", "pipelineresources", "conditions"]
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
- apiGroups: ["tekton.dev"]
resources: ["taskruns/finalizers", "pipelineruns/finalizers"]
Expand Down
12 changes: 12 additions & 0 deletions examples/conditions/alwaysTrue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: tekton.dev/v1alpha1
kind: Condition
metadata:
# General purpose condition for checking if a file exists at the given
name: always-true
spec:
check:
# Check is a container spec describing the container to be run to
# check the condition
image: gcr.io/ubuntu
command: ["/bin/bash"]
args: ['-c', 'ls']
1 change: 0 additions & 1 deletion examples/pipelineruns/demo-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
metadata:
generateName: demo-pr
name: demo-pr
spec:
pipelineRef:
name: list-files-pipeline
Expand Down
14 changes: 7 additions & 7 deletions examples/pipelineruns/pipelinerun-conditional-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ spec:
- name: list-files
taskRef:
name: list-files
conditions:
- conditionRef: stringsEqual
params:
- name: expected
value: master
- name: actual
value: ${input.workspace.revision}
conditions:
- conditionRef: always-true
# params:
# - name: expected
# value: master
# - name: actual
# value: ${input.workspace.revision}
resources:
inputs:
- name: workspace
Expand Down

0 comments on commit c7c5f5d

Please sign in to comment.