From 61e70206253186667a4f77360c53a521a21b4991 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 276136bf2..11f9595cc 100644 --- a/controllers/argocd/policyrule.go +++ b/controllers/argocd/policyrule.go @@ -144,6 +144,17 @@ func policyRuleForServer() []v1.PolicyRule { "list", }, }, + { + APIGroups: []string{ + "batch", + }, + Resources: []string{ + "jobs", + }, + Verbs: []string{ + "create", + }, + }, } } @@ -229,6 +240,17 @@ func policyRuleForServerApplicationSourceNamespaces() []v1.PolicyRule { "delete", }, }, + { + APIGroups: []string{ + "batch", + }, + Resources: []string{ + "jobs", + }, + Verbs: []string{ + "create", + }, + }, } } @@ -270,6 +292,17 @@ func policyRuleForServerClusterRole() []v1.PolicyRule { "list", }, }, + { + APIGroups: []string{ + "batch", + }, + Resources: []string{ + "jobs", + }, + Verbs: []string{ + "create", + }, + }, } }