From ca41c174fbd7fe718a6e75fb17561bc43c507f7d Mon Sep 17 00:00:00 2001 From: Cheng Fang Date: Thu, 8 Feb 2024 19:37:43 -0500 Subject: [PATCH] fix: Create Job from Cronjob feature failing with error cannot create resource "jobs" (#1219) Signed-off-by: Cheng Fang --- controllers/argocd/policyrule.go | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/controllers/argocd/policyrule.go b/controllers/argocd/policyrule.go index 641be10e6..f538e7d0e 100644 --- a/controllers/argocd/policyrule.go +++ b/controllers/argocd/policyrule.go @@ -143,6 +143,17 @@ func policyRuleForServer() []v1.PolicyRule { "list", }, }, + { + APIGroups: []string{ + "batch", + }, + Resources: []string{ + "jobs", + }, + Verbs: []string{ + "create", + }, + }, } } @@ -228,6 +239,17 @@ func policyRuleForServerApplicationSourceNamespaces() []v1.PolicyRule { "delete", }, }, + { + APIGroups: []string{ + "batch", + }, + Resources: []string{ + "jobs", + }, + Verbs: []string{ + "create", + }, + }, } } @@ -269,6 +291,17 @@ func policyRuleForServerClusterRole() []v1.PolicyRule { "list", }, }, + { + APIGroups: []string{ + "batch", + }, + Resources: []string{ + "jobs", + }, + Verbs: []string{ + "create", + }, + }, } }