diff --git a/pkg/v1/remote/write.go b/pkg/v1/remote/write.go index 55abae950..65d4cc9b9 100644 --- a/pkg/v1/remote/write.go +++ b/pkg/v1/remote/write.go @@ -210,6 +210,11 @@ func (w *writer) initiateUpload(ctx context.Context, from, mount, origin string) req.Header.Set("Content-Type", "application/json") resp, err := w.client.Do(req.WithContext(ctx)) if err != nil { + if origin != "" && origin != w.repo.RegistryStr() { + // https://github.com/google/go-containerregistry/issues/1679 + logs.Warn.Printf("retrying without mount: %v", err) + return w.initiateUpload(ctx, "", "", "") + } return "", false, err } defer resp.Body.Close()