Skip to content

Commit

Permalink
remove any '/' trailer from the ExposedRegistryPath (konveyor#1154)
Browse files Browse the repository at this point in the history
  • Loading branch information
vlours committed Jul 22, 2021
1 parent 6bcf60d commit bc47207
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/apis/migration/v1alpha1/migcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc47207

Please sign in to comment.