Explorar o código

nil check for ccp client

David Townley %!s(int64=3) %!d(string=hai) anos
pai
achega
b4e0e32120
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      internal/registry/registry.go

+ 4 - 0
internal/registry/registry.go

@@ -1759,6 +1759,10 @@ func (r *Registry) GetDockerConfigJSON(
 	}
 
 	if proj.CapiProvisionerEnabled && strings.Contains(r.URL, ".azurecr") {
+		if ccpClient == nil {
+			return nil, telemetry.Error(ctx, span, nil, "ccpClient cannot be nil")
+		}
+
 		dockerConfigReq := connect.NewRequest(&porterv1.DockerConfigFileForRegistryRequest{
 			ProjectId:   int64(proj.ID),
 			RegistryUri: r.URL,