From bc472072ff2b2c289163185644b112ba7d5f7bd2 Mon Sep 17 00:00:00 2001 From: Vincent Lours <42592162+vlours@users.noreply.github.com> Date: Thu, 22 Jul 2021 16:57:57 +1000 Subject: [PATCH] remove any '/' trailer from the ExposedRegistryPath (konveyor#1154) --- pkg/apis/migration/v1alpha1/migcluster_types.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/apis/migration/v1alpha1/migcluster_types.go b/pkg/apis/migration/v1alpha1/migcluster_types.go index e25a95513..a6fa7943b 100644 --- a/pkg/apis/migration/v1alpha1/migcluster_types.go +++ b/pkg/apis/migration/v1alpha1/migcluster_types.go @@ -838,9 +838,11 @@ func (m *MigCluster) GetRegistryPath(c k8sclient.Client) (string, error) { if len(m.Spec.ExposedRegistryPath) > 0 { splitPath := strings.Split(m.Spec.ExposedRegistryPath, "//") if len(splitPath) == 2 { - return splitPath[1], nil + // Return the splitPath[1], without any trailer "/" + return strings.TrimRight(splitPath[1], "/"), nil } - return m.Spec.ExposedRegistryPath, nil + // Return the ExposedRegistryPath, without any trailer "/" + return strings.TrimRight(m.Spec.ExposedRegistryPath, "/"), nil } else if !m.Spec.IsHostCluster { // not host cluster and no path specified, return empty path return "", nil