From 0b6d000e681b5ab6409efad52f6558a879bda8e2 Mon Sep 17 00:00:00 2001 From: Jan Lauber Date: Wed, 22 May 2024 21:56:08 +0200 Subject: [PATCH] feat: enhance rbac manifest for cronjobs Signed-off-by: Jan Lauber --- config/rbac/role.yaml | 12 ++++++++++++ controllers/rollout_controller.go | 2 ++ 2 files changed, 14 insertions(+) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 9c4cefd..e1442e2 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -52,6 +52,18 @@ rules: - patch - update - watch +- apiGroups: + - batch + resources: + - cronjobs + verbs: + - create + - delete + - get + - list + - patch + - update + - watch - apiGroups: - "" resources: diff --git a/controllers/rollout_controller.go b/controllers/rollout_controller.go index 999b589..73b43a2 100644 --- a/controllers/rollout_controller.go +++ b/controllers/rollout_controller.go @@ -66,6 +66,8 @@ type RolloutReconciler struct { //+kubebuilder:rbac:groups="",resources=pods,verbs=get;list;watch +//+kubebuilder:rbac:groups=batch,resources=cronjobs,verbs=get;list;watch;create;update;patch;delete + func (r *RolloutReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { log := log.FromContext(ctx)