Skip to content

Commit bc47207

Browse files
committed
remove any '/' trailer from the ExposedRegistryPath (konveyor#1154)
1 parent 6bcf60d commit bc47207

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg/apis/migration/v1alpha1/migcluster_types.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,11 @@ func (m *MigCluster) GetRegistryPath(c k8sclient.Client) (string, error) {
838838
if len(m.Spec.ExposedRegistryPath) > 0 {
839839
splitPath := strings.Split(m.Spec.ExposedRegistryPath, "//")
840840
if len(splitPath) == 2 {
841-
return splitPath[1], nil
841+
// Return the splitPath[1], without any trailer "/"
842+
return strings.TrimRight(splitPath[1], "/"), nil
842843
}
843-
return m.Spec.ExposedRegistryPath, nil
844+
// Return the ExposedRegistryPath, without any trailer "/"
845+
return strings.TrimRight(m.Spec.ExposedRegistryPath, "/"), nil
844846
} else if !m.Spec.IsHostCluster {
845847
// not host cluster and no path specified, return empty path
846848
return "", nil

0 commit comments

Comments
 (0)