2
0
Feroze Mohideen 2 жил өмнө
parent
commit
b70b2e5c51

+ 1 - 1
api/server/handlers/registry/get_token.go

@@ -406,9 +406,9 @@ func (c *RegistryGetACRTokenHandler) ServeHTTP(w http.ResponseWriter, r *http.Re
 	for _, reg := range regs {
 		if reg.AzureIntegrationID != 0 && strings.Contains(reg.URL, "azurecr.io") {
 			_reg := registry.Registry(*reg)
-
 			username, pw, err := _reg.GetACRCredentials(c.Repo())
 			if err != nil {
+				c.HandleAPIError(w, r, apierrors.NewErrInternal(err))
 				continue
 			}
 

+ 5 - 0
internal/registry/registry.go

@@ -866,6 +866,11 @@ func (r *Registry) CreateRepository(
 	}
 
 	if project.CapiProvisionerEnabled {
+		// no need to create repository if pushing to ACR
+		if strings.Contains(r.URL, ".azurecr.") {
+			return nil
+		}
+
 		uri := strings.TrimPrefix(r.URL, "https://")
 		splits := strings.Split(uri, ".")
 		accountID := splits[0]