From d76a2b1906f2e9f97b0511ca82e83885f8e34736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20S=C4=99k?= Date: Mon, 23 Sep 2019 20:07:52 +0200 Subject: [PATCH] Fix run operator with minikube --- pkg/controller/jenkins/client/jenkins.go | 4 ++++ pkg/controller/jenkins/configuration/base/reconcile.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/controller/jenkins/client/jenkins.go b/pkg/controller/jenkins/client/jenkins.go index 63fd89f2..e757073b 100644 --- a/pkg/controller/jenkins/client/jenkins.go +++ b/pkg/controller/jenkins/client/jenkins.go @@ -94,6 +94,10 @@ func BuildJenkinsAPIUrl(namespace, serviceName string, portNumber int32, local, // First is for http, the second one is for Jenkins slaves communication // see pkg/controller/jenkins/configuration/base/resources/service.go url := lines[0] + if strings.HasPrefix(url, "* ") { + return url[2:], nil + } + return url, nil } diff --git a/pkg/controller/jenkins/configuration/base/reconcile.go b/pkg/controller/jenkins/configuration/base/reconcile.go index 7bf7e210..41c0c1ed 100644 --- a/pkg/controller/jenkins/configuration/base/reconcile.go +++ b/pkg/controller/jenkins/configuration/base/reconcile.go @@ -788,7 +788,7 @@ func (r *ReconcileJenkinsBaseConfiguration) ensureJenkinsClient(meta metav1.Obje if err != nil { return nil, err } - r.logger.V(log.VDebug).Info(fmt.Sprintf("Jenkins API URL %s", jenkinsURL)) + r.logger.V(log.VDebug).Info(fmt.Sprintf("Jenkins API URL '%s'", jenkinsURL)) credentialsSecret := &corev1.Secret{} err = r.k8sClient.Get(context.TODO(), types.NamespacedName{Name: resources.GetOperatorCredentialsSecretName(r.jenkins), Namespace: r.jenkins.ObjectMeta.Namespace}, credentialsSecret)