From 5ffbce7c7885099548ac18bc856e6af239dcf4d9 Mon Sep 17 00:00:00 2001 From: jkhelil Date: Mon, 6 Jul 2020 11:00:10 +0200 Subject: [PATCH 1/2] add routes resources authorization to jenkins-operator service account --- deploy/role.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/role.yaml b/deploy/role.yaml index c4e0059b..2e0fdebd 100644 --- a/deploy/role.yaml +++ b/deploy/role.yaml @@ -11,6 +11,7 @@ rules: - configmaps - secrets - serviceaccounts + - routes verbs: - get - create From 14cd8b7724d2edad71f59fe7d607dd8eaac218b6 Mon Sep 17 00:00:00 2001 From: jkhelil Date: Wed, 8 Jul 2020 08:46:06 +0200 Subject: [PATCH 2/2] fix route name --- deploy/role.yaml | 1 - pkg/configuration/base/route.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/deploy/role.yaml b/deploy/role.yaml index edd4b969..a2653abc 100644 --- a/deploy/role.yaml +++ b/deploy/role.yaml @@ -11,7 +11,6 @@ rules: - configmaps - secrets - serviceaccounts - - routes verbs: - get - create diff --git a/pkg/configuration/base/route.go b/pkg/configuration/base/route.go index baf467ef..585b178f 100644 --- a/pkg/configuration/base/route.go +++ b/pkg/configuration/base/route.go @@ -18,7 +18,7 @@ import ( // createRoute takes the ServiceName and Creates the Route based on it func (r *ReconcileJenkinsBaseConfiguration) createRoute(meta metav1.ObjectMeta, serviceName string, config *v1alpha2.Jenkins) error { route := routev1.Route{} - name := fmt.Sprintf("%s-%s", config.ObjectMeta.Name, config.ObjectMeta.Namespace) + name := fmt.Sprintf("jenkins-%s", config.ObjectMeta.Name) err := r.Client.Get(context.TODO(), types.NamespacedName{Name: name, Namespace: meta.Namespace}, &route) if err != nil && apierrors.IsNotFound(err) { port := &routev1.RoutePort{