forked from tektoncd/triggers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing TriggerGroups as inline EventListener resource
This feature allows an operator to specify a set of interceptors that will be executed before a group of triggers are selected and executed. This allows common data to be passed from interceptor execution down to multiple triggers to solve a set of common use cases across multiple Triggers. This feature is enabled for now inline in the EventListener spec, but in the future may be enabled only in alpha once the feature gates proposal is implemented within this project. Addresses tektoncd#945
- Loading branch information
1 parent
ae9b7eb
commit 9898086
Showing
19 changed files
with
525 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
examples/v1beta1/triggergroups/eventlistener-triggergroup.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: triggers.tekton.dev/v1beta1 | ||
kind: EventListener | ||
metadata: | ||
name: listener-triggergroup | ||
spec: | ||
serviceAccountName: tekton-triggers-example-sa | ||
triggerGroups: | ||
- name: github-pr | ||
interceptors: | ||
- ref: | ||
name: "cel" | ||
params: | ||
- name: "filter" | ||
value: "header.match('X-GitHub-Event', 'pull_request')" | ||
- name: "overlays" | ||
value: | ||
- key: truncated_sha | ||
expression: "body.pull_request.head.sha.truncate(7)" | ||
triggerSelector: | ||
labelSelector: | ||
matchLabels: | ||
type: github-pr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../rbac.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
apiVersion: triggers.tekton.dev/v1beta1 | ||
kind: Trigger | ||
metadata: | ||
name: trigger | ||
labels: | ||
type: github-pr | ||
spec: | ||
bindings: | ||
- name: gitrevision | ||
value: $(extensions.truncated_sha) | ||
- name: gitrepositoryurl | ||
value: $(body.repository.url) | ||
- name: contenttype | ||
value: $(header.Content-Type) | ||
template: | ||
ref: pipeline-template | ||
--- | ||
apiVersion: triggers.tekton.dev/v1beta1 | ||
kind: TriggerTemplate | ||
metadata: | ||
name: pipeline-template | ||
spec: | ||
params: | ||
- name: gitrevision | ||
description: The git revision | ||
default: main | ||
- name: gitrepositoryurl | ||
description: The git repository url | ||
- name: message | ||
description: The message to print | ||
default: This is the default message | ||
- name: contenttype | ||
description: The Content-Type of the event | ||
resourcetemplates: | ||
- apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: simple-pipeline-run- | ||
spec: | ||
pipelineRef: | ||
name: simple-pipeline | ||
params: | ||
- name: message | ||
value: $(tt.params.message) | ||
- name: contenttype | ||
value: $(tt.params.contenttype) | ||
resources: | ||
- name: git-source | ||
resourceSpec: | ||
type: git | ||
params: | ||
- name: revision | ||
value: $(tt.params.gitrevision) | ||
- name: url | ||
value: $(tt.params.gitrepositoryurl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.