Skip to content

Commit

Permalink
Webhook has only namespaced Secret permissions, rather than cluster-w…
Browse files Browse the repository at this point in the history
…ide. (#4684)
  • Loading branch information
Harwayne authored Jan 6, 2021
1 parent 37af017 commit f4b5fd4
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/200-webhook-role.yaml
18 changes: 18 additions & 0 deletions config/core/200-webhook-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ roleRef:

---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
namespace: knative-eventing
name: eventing-webhook
labels:
eventing.knative.dev/release: devel
subjects:
- kind: ServiceAccount
name: eventing-webhook
namespace: knative-eventing
roleRef:
kind: Role
name: knative-eventing-webhook
apiGroup: rbac.authorization.k8s.io

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand Down
1 change: 0 additions & 1 deletion config/core/roles/webhook-clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ rules:
- apiGroups:
- ""
resources:
- "secrets"
- "namespaces"
verbs:
- "get"
Expand Down
34 changes: 34 additions & 0 deletions config/core/roles/webhook-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2020 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: knative-eventing
name: knative-eventing-webhook
labels:
eventing.knative.dev/release: devel
rules:
# For manipulating certs into secrets.
- apiGroups:
- ""
resources:
- "secrets"
verbs:
- "get"
- "create"
- "update"
- "list"
- "watch"
- "patch"

0 comments on commit f4b5fd4

Please sign in to comment.