From f24433e290a0873544e172811c7e5f3d42120b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Mon, 15 Aug 2022 15:12:24 +0200 Subject: [PATCH 1/4] Pin Go to 1.18 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.19 has changed the expected gofmt format, and we don't want to follow such changes on the stable branch. go@1.18 is "keg-only", i.e. not installed by Brew to /usr/local/bin, so we need to change PATH to point at it (as the installation instructs us to). Signed-off-by: Miloslav Trmač --- .cirrus.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index d4ebd8e9..e48403d6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -84,12 +84,13 @@ osx_task: macos_instance: image: catalina-xcode setup_script: | - export PATH=$GOPATH/bin:$PATH + # /usr/local/opt/go@1.18 will be populated by (brew install go@1.18) below + export PATH=$GOPATH/bin:/usr/local/opt/go@1.18/bin:$PATH brew update - brew install gpgme go go-md2man + brew install gpgme go@1.18 go-md2man go install golang.org/x/lint/golint@latest test_script: | - export PATH=$GOPATH/bin:$PATH + export PATH=$GOPATH/bin:/usr/local/opt/go@1.18/bin:$PATH go version go env make validate-local test-unit-local bin/skopeo From 2382f751cb7a8dedf77f4dd17406b62dd293d4c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 19 Oct 2022 18:48:20 +0200 Subject: [PATCH 2/4] Update to c/image v5.22.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > go get github.com/containers/image/v5@v5.22.1 > make vendor Signed-off-by: Miloslav Trmač --- go.mod | 2 +- go.sum | 3 ++- .../image/v5/docker/docker_client.go | 25 +++++++++++++------ .../image/v5/docker/docker_image_dest.go | 1 + .../containers/image/v5/docker/errors.go | 3 ++- .../containers/image/v5/version/version.go | 2 +- vendor/modules.txt | 2 +- 7 files changed, 26 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index 84e83f3a..cf619c1a 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 require ( github.com/containers/common v0.49.1 - github.com/containers/image/v5 v5.22.0 + github.com/containers/image/v5 v5.22.1 github.com/containers/ocicrypt v1.1.5 github.com/containers/storage v1.42.0 github.com/docker/docker v20.10.17+incompatible diff --git a/go.sum b/go.sum index 92b729d6..c12828da 100644 --- a/go.sum +++ b/go.sum @@ -371,8 +371,9 @@ github.com/containernetworking/plugins v1.0.1/go.mod h1:QHCfGpaTwYTbbH+nZXKVTxNB github.com/containernetworking/plugins v1.1.1/go.mod h1:Sr5TH/eBsGLXK/h71HeLfX19sZPp3ry5uHSkI4LPxV8= github.com/containers/common v0.49.1 h1:6y4/s2WwYxrv+Cox7fotOo316wuZI+iKKPUQweCYv50= github.com/containers/common v0.49.1/go.mod h1:ueM5hT0itKqCQvVJDs+EtjornAQtrHYxQJzP2gxeGIg= -github.com/containers/image/v5 v5.22.0 h1:KemxPmD4D2YYOFZN2SgoTk7nBFcnwPiPW0MqjYtknSE= github.com/containers/image/v5 v5.22.0/go.mod h1:D8Ksv2RNB8qLJ7xe1P3rgJJOSQpahA6amv2Ax++/YO4= +github.com/containers/image/v5 v5.22.1 h1:Oj8C/ACrNn18f8MNTqOeBOHAN51GF1rEhoVSCA/ylvI= +github.com/containers/image/v5 v5.22.1/go.mod h1:D8Ksv2RNB8qLJ7xe1P3rgJJOSQpahA6amv2Ax++/YO4= github.com/containers/libtrust v0.0.0-20200511145503-9c3a6c22cd9a h1:spAGlqziZjCJL25C6F1zsQY05tfCKE9F5YwtEWWe6hU= github.com/containers/libtrust v0.0.0-20200511145503-9c3a6c22cd9a/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= diff --git a/vendor/github.com/containers/image/v5/docker/docker_client.go b/vendor/github.com/containers/image/v5/docker/docker_client.go index 5de07674..3f20346f 100644 --- a/vendor/github.com/containers/image/v5/docker/docker_client.go +++ b/vendor/github.com/containers/image/v5/docker/docker_client.go @@ -1,6 +1,7 @@ package docker import ( + "bytes" "context" "crypto/tls" "encoding/json" @@ -921,15 +922,25 @@ func (c *dockerClient) getOCIDescriptorContents(ctx context.Context, ref dockerR // isManifestUnknownError returns true iff err from fetchManifest is a “manifest unknown” error. func isManifestUnknownError(err error) bool { var errs errcode.Errors - if !errors.As(err, &errs) || len(errs) == 0 { - return false + if errors.As(err, &errs) && len(errs) != 0 { + firstErr := errs[0] + // docker/distribution, and as defined in the spec + var ec errcode.ErrorCoder + if errors.As(firstErr, &ec) && ec.ErrorCode() == v2.ErrorCodeManifestUnknown { + return true + } + // registry.redhat.io as of October 2022 + var e errcode.Error + if errors.As(firstErr, &e) && e.ErrorCode() == errcode.ErrorCodeUnknown && e.Message == "Not Found" { + return true + } } - err = errs[0] - ec, ok := err.(errcode.ErrorCoder) - if !ok { - return false + // ALSO registry.redhat.io as of October 2022 + var unexpected *clientLib.UnexpectedHTTPResponseError + if errors.As(err, &unexpected) && unexpected.StatusCode == http.StatusNotFound && bytes.Contains(unexpected.Response, []byte("Not found")) { + return true } - return ec.ErrorCode() == v2.ErrorCodeManifestUnknown + return false } // getSigstoreAttachmentManifest loads and parses the manifest for sigstore attachments for diff --git a/vendor/github.com/containers/image/v5/docker/docker_image_dest.go b/vendor/github.com/containers/image/v5/docker/docker_image_dest.go index 6cd693b6..f42ae988 100644 --- a/vendor/github.com/containers/image/v5/docker/docker_image_dest.go +++ b/vendor/github.com/containers/image/v5/docker/docker_image_dest.go @@ -652,6 +652,7 @@ func (d *dockerImageDestination) putSignaturesToSigstoreAttachments(ctx context. Digest: "", // We will fill this in later. Size: 0, }, nil) + ociConfig.RootFS.Type = "layers" } else { logrus.Debugf("Fetching sigstore attachment config %s", ociManifest.Config.Digest.String()) // We don’t benefit from a real BlobInfoCache here because we never try to reuse/mount configs. diff --git a/vendor/github.com/containers/image/v5/docker/errors.go b/vendor/github.com/containers/image/v5/docker/errors.go index 79590c4c..e47f6e86 100644 --- a/vendor/github.com/containers/image/v5/docker/errors.go +++ b/vendor/github.com/containers/image/v5/docker/errors.go @@ -54,7 +54,8 @@ func registryHTTPResponseToError(res *http.Response) error { if len(response) > 50 { response = response[:50] + "..." } - err = fmt.Errorf("StatusCode: %d, %s", e.StatusCode, response) + // %.0w makes e visible to error.Unwrap() without including any text + err = fmt.Errorf("StatusCode: %d, %s%.0w", e.StatusCode, response, e) } return err } diff --git a/vendor/github.com/containers/image/v5/version/version.go b/vendor/github.com/containers/image/v5/version/version.go index d69adb54..9774054b 100644 --- a/vendor/github.com/containers/image/v5/version/version.go +++ b/vendor/github.com/containers/image/v5/version/version.go @@ -8,7 +8,7 @@ const ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor = 22 // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 0 + VersionPatch = 1 // VersionDev indicates development branch. Releases will be empty string. VersionDev = "" diff --git a/vendor/modules.txt b/vendor/modules.txt index 742d1bc4..3569a459 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -61,7 +61,7 @@ github.com/containers/common/pkg/flag github.com/containers/common/pkg/report github.com/containers/common/pkg/report/camelcase github.com/containers/common/pkg/retry -# github.com/containers/image/v5 v5.22.0 +# github.com/containers/image/v5 v5.22.1 ## explicit; go 1.17 github.com/containers/image/v5/copy github.com/containers/image/v5/directory From 89966c513c89061d288690da671643d50968ca3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 19 Oct 2022 18:49:58 +0200 Subject: [PATCH 3/4] Release 1.9.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index 3b125135..d44b7eac 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // Version is the version of the build. -const Version = "1.9.3-dev" +const Version = "1.9.3" From 4ff5773f8a37c6f0bfd5552fd5ac43fdb4996b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 19 Oct 2022 18:50:09 +0200 Subject: [PATCH 4/4] Bump to v1.9.4-dev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miloslav Trmač --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index d44b7eac..46a6f50b 100644 --- a/version/version.go +++ b/version/version.go @@ -1,4 +1,4 @@ package version // Version is the version of the build. -const Version = "1.9.3" +const Version = "1.9.4-dev"