From 8a7e2a30d4e286cde60c0422eb823b942eb18eca Mon Sep 17 00:00:00 2001 From: Shingo Omura Date: Fri, 6 Jul 2018 17:25:37 +0900 Subject: [PATCH] update go-containerregistry so that kaniko works nicely with Harbor or Gitlab. --- Gopkg.lock | 2 +- .../google/go-containerregistry/pkg/v1/remote/write.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index d44f11eba6..947c0b1b04 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -399,7 +399,7 @@ "pkg/v1/types", "pkg/v1/v1util" ] - revision = "3f6471078a9661a9a439bd5e71a371aff429566a" + revision = "d54baf9aa28edb9b985a6b35b57e26e3410c2443" [[projects]] name = "github.com/googleapis/gax-go" diff --git a/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go b/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go index 57e4a1fad5..7781929593 100644 --- a/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go +++ b/vendor/github.com/google/go-containerregistry/pkg/v1/remote/write.go @@ -145,7 +145,9 @@ func (w *writer) initiateUpload(h v1.Hash) (location string, mounted bool, err e // if "mount" is specified, even if no "from" sources are specified. If this turns out // to not be broadly applicable then we should replace mounts without "from"s with a HEAD. if ml, ok := l.(*MountableLayer); ok { - uv["from"] = []string{ml.Reference.Context().RepositoryStr()} + if w.ref.Context().RegistryStr() == ml.Reference.Context().RegistryStr() { + uv["from"] = []string{ml.Reference.Context().RepositoryStr()} + } } u.RawQuery = uv.Encode()