From 3d4d4b0afbf31864e05c4c04651c4b44ef178c03 Mon Sep 17 00:00:00 2001 From: Filipe Regadas Date: Tue, 5 Apr 2022 15:45:48 +0100 Subject: [PATCH] Register PodDisruptionBudget and add rbac rule (#358) * Register PodDisruptionBudget and add rbac rule --- config/rbac/role.yaml | 10 ++++++++++ main.go | 2 ++ 2 files changed, 12 insertions(+) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index e5043db6..abbf3e62 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -113,6 +113,16 @@ rules: - patch - update - watch + - apiGroups: + - "policy" + resources: + - poddisruptionbudgets + verbs: + - create + - delete + - get + - list + - watch - apiGroups: - "" resources: diff --git a/main.go b/main.go index 0a807276..27e735fa 100644 --- a/main.go +++ b/main.go @@ -24,6 +24,7 @@ import ( batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" + policyv1 "k8s.io/api/policy/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/kubernetes" _ "k8s.io/client-go/plugin/pkg/client/auth/gcp" @@ -54,6 +55,7 @@ func init() { corev1.AddToScheme(scheme) v1beta1.AddToScheme(scheme) networkingv1.AddToScheme(scheme) + policyv1.AddToScheme(scheme) // +kubebuilder:scaffold:scheme }