apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: tekton-pipelines-webhook
  namespace: tekton-pipelines
  labels:
    app.kubernetes.io/component: webhook
    app.kubernetes.io/instance: default
    app.kubernetes.io/part-of: tekton-pipelines
rules:
- resources: ["configmaps"]
  apiGroups: [""]
  verbs: ["list", "watch"]
# The webhook needs access to these configmaps for logging information.
- resources: ["configmaps"]
  apiGroups: [""]
  resourceNames: ["config-logging", "config-observability", "config-leader-election", "feature-flags"]
  verbs: ["get"]
- resources: ["secrets"]
  apiGroups: [""]
  verbs: ["list", "watch"]
# The webhook daemon makes a reconciliation loop on webhook-certs. Whenever
# the secret changes it updates the webhook configurations with the certificates
# stored in the secret.
- resources: ["secrets"]
  apiGroups: [""]
  resourceNames: ["webhook-certs"]
  verbs: ["get", "update"]
- resources: ["podsecuritypolicies"]
  apiGroups: ["policy"]
  resourceNames: ["tekton-pipelines"]
  verbs: ["use"]
