ClusterTriggerBindings
ClusterTriggerBindings
is similar to TriggerBinding which is used to extractfield from event payload. The only difference is it is cluster-scoped anddesigned to encourage reusability clusterwide. You can reference aClusterTriggerBinding in any EventListener in any namespace.
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterTriggerBinding
metadata:
name: pipeline-clusterbinding
spec:
params:
- name: gitrevision
value: $(body.head_commit.id)
- name: gitrepositoryurl
value: $(body.repository.url)
- name: contenttype
value: $(header.Content-Type)
You can specify multiple ClusterTriggerBindings in a Trigger. You can use aClusterTriggerBinding in multiple Triggers.
In case of using a ClusterTriggerBinding, the Binding
kind should be added.The default kind is TriggerBinding which represents a namespaced TriggerBinding.
---
apiVersion: triggers.tekton.dev/v1alpha1
kind: EventListener
metadata:
name: listener-clustertriggerbinding
spec:
serviceAccountName: tekton-triggers-example-sa
triggers:
- name: foo-trig
bindings:
- name: pipeline-clusterbinding
kind: ClusterTriggerBinding
- name: message-clusterbinding
kind: ClusterTriggerBinding
template:
name: pipeline-template