Skip to content

Commit

Permalink
chore(apps/prod/tekton/configs/triggers): limit harbor push event res…
Browse files Browse the repository at this point in the history
…ource url

limit it to special server

Signed-off-by: wuhuizuo <wuhuizuo@126.com>
  • Loading branch information
wuhuizuo committed Aug 15, 2024
1 parent 29924b5 commit 62ccebc
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,3 @@ spec:
labelSelector:
matchLabels:
type: image-push
---
apiVersion: triggers.tekton.dev/v1beta1
kind: EventListener
metadata:
name: internal-debug
spec:
serviceAccountName: tekton-trigger-eventlistener
triggerGroups:
- name: harbor-image-pushed-debug
interceptors:
- name: filter on image push events on inner container repositories.
ref:
name: "cel"
params:
- name: filter
value: >-
body.type == 'PUSH_ARTIFACT'
&&
body.event_data.repository.namespace in ['pingcap', 'tikv']
&&
! body.event_data.resources[0].tag.startsWith('sha256:')
triggerSelector:
namespaceSelector:
matchNames:
- ee-cd
labelSelector:
matchLabels:
type: image-push-debug
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ spec:
'tikv/tikv/package'
] &&
body.event_data.resources[0].tag.matches('^(master|main)(-[0-9a-f]{7,10})_(darwin|linux)_(amd64|arm64)$')
&&
body.event_data.resources[0].resource_url.startsWith('hub.pingcap.net/')
- name: overlays
value:
- key: git-url
Expand Down Expand Up @@ -68,6 +70,8 @@ spec:
'tikv/tikv/package'
] &&
body.event_data.resources[0].tag.matches('^release-[0-9]+[.][0-9]+(-[0-9a-f]{7,10})_(darwin|linux)_(amd64|arm64)$')
&&
body.event_data.resources[0].resource_url.startsWith('hub.pingcap.net/')
- name: overlays
value:
- key: git-url
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
body.event_data.repository.repo_full_name.matches('/package(s)?')
&&
body.event_data.resources[0].tag.matches('^(master|main)_(darwin|linux)_(amd64|arm64)$')
&&
body.event_data.resources[0].resource_url.startsWith('hub.pingcap.net/')
bindings:
- ref: harbor-image-push
- { name: nightly, value: "true" }
Expand All @@ -42,6 +44,8 @@ spec:
body.event_data.repository.repo_full_name.matches('/package(s)?')
&&
body.event_data.resources[0].tag.matches('^(release-[0-9]+[.][0-9]+)_(linux|darwin)_(amd64|arm64)$')
&&
body.event_data.resources[0].resource_url.startsWith('hub.pingcap.net/')
bindings:
- ref: harbor-image-push
template:
Expand All @@ -66,6 +70,8 @@ spec:
body.event_data.repository.repo_full_name.matches('/package(s)?')
&&
body.event_data.resources[0].tag.matches('^v[0-9]+[.][0-9]+[.][0-9]+_(linux|darwin)_(amd64|arm64)$')
&&
body.event_data.resources[0].resource_url.startsWith('hub.pingcap.net/')
bindings:
- ref: harbor-image-push
template:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ spec:
)
&&
body.event_data.resources[0].tag.matches('[-_](amd64|arm64)$')
&&
body.event_data.resources[0].resource_url.startsWith('hub.pingcap.net/')
bindings:
- ref: harbor-image-push
template:
Expand Down Expand Up @@ -46,6 +48,8 @@ spec:
body.event_data.repository.repo_full_name.matches('/package(s)?')
) &&
body.event_data.resources[0].tag.matches('^(master|main|release-[0-9]+[.][0-9]+|v[0-9]+[.][0-9]+[.][0-9]+(-pre)?)(-[0-9a-f]+)?(-(enterprise|failpoint))?$')
&&
body.event_data.resources[0].resource_url.startsWith('hub.pingcap.net/')
bindings:
- ref: harbor-image-push
Expand Down

0 comments on commit 62ccebc

Please sign in to comment.