Skip to content

Commit

Permalink
Add watch verb to the controller
Browse files Browse the repository at this point in the history
This commit fixes the:
"Failed to watch apiextensions.k8s.io/v1 ..."
"Failed to watch admissionregistration.k8s.io/v1..."
errors, by adding the "watch" verb to the required YAMLs.

fix #1689

Signed-off-by: liornoy <lnoy@redhat.com>
  • Loading branch information
liornoy committed Jan 24, 2023
1 parent bce34f0 commit fba8ee3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/metallb/templates/rbac.yaml
Expand Up @@ -21,15 +21,15 @@ rules:
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
- apiGroups: ["admissionregistration.k8s.io"]
resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"]
verbs: ["list"]
verbs: ["list", "watch"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
resourceNames: ["addresspools.metallb.io","bfdprofiles.metallb.io","bgpadvertisements.metallb.io",
"bgppeers.metallb.io","ipaddresspools.metallb.io","l2advertisements.metallb.io","communities.metallb.io"]
verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]
- apiGroups: ["apiextensions.k8s.io"]
resources: ["customresourcedefinitions"]
verbs: ["list"]
verbs: ["list", "watch"]
{{- if .Values.prometheus.secureMetricsPort }}
- apiGroups: ["authentication.k8s.io"]
resources: ["tokenreviews"]
Expand Down
2 changes: 2 additions & 0 deletions config/manifests/metallb-frr-prometheus.yaml
Expand Up @@ -1589,6 +1589,7 @@ rules:
- mutatingwebhookconfigurations
verbs:
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resourceNames:
Expand All @@ -1615,6 +1616,7 @@ rules:
- customresourcedefinitions
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
2 changes: 2 additions & 0 deletions config/manifests/metallb-frr.yaml
Expand Up @@ -1560,6 +1560,7 @@ rules:
- mutatingwebhookconfigurations
verbs:
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resourceNames:
Expand All @@ -1586,6 +1587,7 @@ rules:
- customresourcedefinitions
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
2 changes: 2 additions & 0 deletions config/manifests/metallb-native-prometheus.yaml
Expand Up @@ -1589,6 +1589,7 @@ rules:
- mutatingwebhookconfigurations
verbs:
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resourceNames:
Expand All @@ -1615,6 +1616,7 @@ rules:
- customresourcedefinitions
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
2 changes: 2 additions & 0 deletions config/manifests/metallb-native.yaml
Expand Up @@ -1560,6 +1560,7 @@ rules:
- mutatingwebhookconfigurations
verbs:
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resourceNames:
Expand All @@ -1586,6 +1587,7 @@ rules:
- customresourcedefinitions
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
2 changes: 2 additions & 0 deletions config/rbac/role.yaml
Expand Up @@ -57,6 +57,7 @@ rules:
- mutatingwebhookconfigurations
verbs:
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
Expand All @@ -83,6 +84,7 @@ rules:
- customresourcedefinitions
verbs:
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down

0 comments on commit fba8ee3

Please sign in to comment.