From c899e98d57b903c66c31fd2d7a4932ad54fc5517 Mon Sep 17 00:00:00 2001 From: Aditya R Date: Wed, 23 Mar 2022 22:44:33 +0530 Subject: [PATCH 1/4] vendor: bump c/storage to v1.38.3 Signed-off-by: Aditya R --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2ce13f9d3..d8c55ca93 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/containerd/containerd v1.5.9 // indirect github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b github.com/containers/ocicrypt v1.1.2 - github.com/containers/storage v1.38.2 + github.com/containers/storage v1.38.3 github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v20.10.12+incompatible github.com/docker/docker-credential-helpers v0.6.4 diff --git a/go.sum b/go.sum index 5a1a50502..9acd9da22 100644 --- a/go.sum +++ b/go.sum @@ -273,6 +273,8 @@ github.com/containers/ocicrypt v1.1.2 h1:Ez+GAMP/4GLix5Ywo/fL7O0nY771gsBIigiqUm1 github.com/containers/ocicrypt v1.1.2/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= github.com/containers/storage v1.38.2 h1:8bAIxnVBGKzMw5EWCivVj24bztQT6IkDp4uHiyhnzwE= github.com/containers/storage v1.38.2/go.mod h1:INP0RPLHWBxx+pTsO5uiHlDUGHDFvWZPWprAbAlQWPQ= +github.com/containers/storage v1.38.3 h1:GP1JU51sgwuqEu4+Lp8taBsqbkHgHVqzb/uzqZF9HOc= +github.com/containers/storage v1.38.3/go.mod h1:INP0RPLHWBxx+pTsO5uiHlDUGHDFvWZPWprAbAlQWPQ= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= From 74c558200818b10ec22957177a0f1eabf162260f Mon Sep 17 00:00:00 2001 From: Aditya R Date: Wed, 23 Mar 2022 22:45:56 +0530 Subject: [PATCH 2/4] storage: use race-free AddNames instead of SetNames Commits from parallel builds using `SetNames` removes `names` from storage for other builds. Use race-free atomic `AddNames` to prevent breaking of parallel builds. Signed-off-by: Aditya R --- storage/storage_image.go | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/storage/storage_image.go b/storage/storage_image.go index 7329ef6ee..c44c95280 100644 --- a/storage/storage_image.go +++ b/storage/storage_image.go @@ -1192,21 +1192,13 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t } logrus.Debugf("saved image metadata %q", string(metadata)) } - // Set the reference's name on the image. We don't need to worry about avoiding duplicate - // values because SetNames() will deduplicate the list that we pass to it. - if name := s.imageRef.DockerReference(); len(oldNames) > 0 || name != nil { - names := []string{} - if name != nil { - names = append(names, name.String()) + // Adds the reference's name on the image. We don't need to worry about avoiding duplicate + // values because AddNames() will deduplicate the list that we pass to it. + if name := s.imageRef.DockerReference(); name != nil { + if err := s.imageRef.transport.store.AddNames(img.ID, []string{name.String()}); err != nil { + return errors.Wrapf(err, "adding names %v to image %q", name, img.ID) } - if len(oldNames) > 0 { - names = append(names, oldNames...) - } - if err := s.imageRef.transport.store.SetNames(img.ID, names); err != nil { - logrus.Debugf("error setting names %v on image %q: %v", names, img.ID, err) - return errors.Wrapf(err, "setting names %v on image %q", names, img.ID) - } - logrus.Debugf("set names of image %q to %v", img.ID, names) + logrus.Debugf("added name %q to image %q", name, img.ID) } commitSucceeded = true From 9b1b7f24a64a87330e85bc5b9afc0c3996a1815d Mon Sep 17 00:00:00 2001 From: Aditya R Date: Wed, 23 Mar 2022 22:48:03 +0530 Subject: [PATCH 3/4] version: remove -dev and mark version as 5.19.2 Signed-off-by: Aditya R --- version/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version/version.go b/version/version.go index a9163e059..4a9132563 100644 --- a/version/version.go +++ b/version/version.go @@ -11,7 +11,7 @@ const ( VersionPatch = 2 // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "-dev" + VersionDev = "" ) // Version is the specification version that the package types support. From 151f49b7aedb2da16a8b724d43a85f01247331ff Mon Sep 17 00:00:00 2001 From: Aditya R Date: Wed, 23 Mar 2022 22:48:32 +0530 Subject: [PATCH 4/4] version: add dev and bump to 5.19.3 Signed-off-by: Aditya R --- version/version.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version/version.go b/version/version.go index 4a9132563..a738c1d11 100644 --- a/version/version.go +++ b/version/version.go @@ -8,10 +8,10 @@ const ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor = 19 // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 2 + VersionPatch = 3 // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "" + VersionDev = "-dev" ) // Version is the specification version that the package types support.