From a29db7db2c9e61e81e77b639471323ada0991497 Mon Sep 17 00:00:00 2001 From: Jonathan West Date: Mon, 1 Apr 2024 10:28:54 -0400 Subject: [PATCH] Add route to ClusterRole/Role, update plugin name in ConfigMap Signed-off-by: Jonathan West --- config/rbac/role.yaml | 11 +++++++++++ controllers/argorollouts_controller.go | 1 + controllers/default.go | 4 ++-- controllers/resources.go | 16 ++++++++++++++++ 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index d13dcb5..6c02453 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -275,6 +275,17 @@ rules: - patch - update - watch +- apiGroups: + - route.openshift.io + resources: + - routes + verbs: + - create + - get + - list + - patch + - update + - watch - apiGroups: - split.smi-spec.io resources: diff --git a/controllers/argorollouts_controller.go b/controllers/argorollouts_controller.go index 3c09610..832a219 100644 --- a/controllers/argorollouts_controller.go +++ b/controllers/argorollouts_controller.go @@ -76,6 +76,7 @@ var log = logr.Log.WithName("rollouts-controller") //+kubebuilder:rbac:groups="traefik.containo.us",resources=traefikservices,verbs=watch;get;update //+kubebuilder:rbac:groups="x.getambassador.io",resources=ambassadormappings;mappings,verbs=create;watch;get;update;list;delete //+kubebuilder:rbac:groups="apisix.apache.org",resources=apisixroutes,verbs=watch;get;update +//+kubebuilder:rbac:groups="route.openshift.io",resources=routes,verbs=create;watch;get;update;patch;list // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. diff --git a/controllers/default.go b/controllers/default.go index 1c19a12..c2c2ec8 100644 --- a/controllers/default.go +++ b/controllers/default.go @@ -19,12 +19,12 @@ const ( DefaultRolloutsSelectorKey = "app.kubernetes.io/name" // OpenShiftRolloutPluginName is the plugin name for Openshift Route Plugin - OpenShiftRolloutPluginName = "argoproj-labs/openshift-route-plugin" + OpenShiftRolloutPluginName = "argoproj-labs/openshift" // DefaultRolloutsConfigMapName is the default name of the ConfigMap that contains the Rollouts controller configuration DefaultRolloutsConfigMapName = "argo-rollouts-config" - DefaultOpenShiftRoutePluginURL = "https://github.com/argoproj-labs/rollouts-plugin-trafficrouter-openshift/releases/download/commit-2749e0ac96ba00ce6f4af19dc6d5358048227d77/rollouts-plugin-trafficrouter-openshift-linux-amd64" + DefaultOpenShiftRoutePluginURL = "https://github.com/argoproj-labs/rollouts-plugin-trafficrouter-openshift/releases/download/commit-8d0b3c6c5c18341f9f019cf1015b56b0d0c6085b/rollouts-plugin-trafficrouter-openshift-linux-amd64" // NamespaceScopedArgoRolloutsController is an environment variable that can be used to configure scope of Argo Rollouts controller // Set true to allow only namespace-scoped Argo Rollouts controller deployment and false for cluster-scoped diff --git a/controllers/resources.go b/controllers/resources.go index 9c8259b..f90b368 100644 --- a/controllers/resources.go +++ b/controllers/resources.go @@ -832,6 +832,22 @@ func GetPolicyRules() []rbacv1.PolicyRule { "update", }, }, + { + APIGroups: []string{ + "route.openshift.io", + }, + Resources: []string{ + "routes", + }, + Verbs: []string{ + "create", + "watch", + "get", + "update", + "patch", + "list", + }, + }, } }