Explorar o código

remove protocol from registry list

Alexander Belanger %!s(int64=5) %!d(string=hai) anos
pai
achega
59abdffeb7
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      internal/models/registry.go

+ 8 - 1
internal/models/registry.go

@@ -71,11 +71,18 @@ func (r *Registry) Externalize() *RegistryExternal {
 		serv = integrations.DockerHub
 	}
 
+	uri := r.URL
+
+	// remove the protocol
+	if splStr := strings.Split(uri, "://"); len(splStr) > 1 {
+		uri = splStr[1]
+	}
+
 	return &RegistryExternal{
 		ID:        r.ID,
 		ProjectID: r.ProjectID,
 		Name:      r.Name,
-		URL:       r.URL,
+		URL:       uri,
 		Service:   serv,
 		InfraID:   r.InfraID,
 	}