fix route name

This commit is contained in:
jkhelil 2020-07-08 08:46:06 +02:00
parent c62d22bba2
commit 14cd8b7724
2 changed files with 1 additions and 2 deletions

View File

@ -11,7 +11,6 @@ rules:
- configmaps
- secrets
- serviceaccounts
- routes
verbs:
- get
- create

View File

@ -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{