From fd6324f800d93fe703325f6fe90d11b07d3c9074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 13 Sep 2017 17:51:48 +0200 Subject: [PATCH 1/2] Vendor after merging mtrmac/image:manifest-list-hotfix --- .../containers/image/manifest/manifest.go | 2 +- .../containers/image/ostree/ostree_dest.go | 2 +- .../image/ostree/ostree_transport.go | 23 ++++++------------- .../containers/image/types/types.go | 2 ++ 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/vendor/github.com/containers/image/manifest/manifest.go b/vendor/github.com/containers/image/manifest/manifest.go index 605bab1d..e329ee57 100644 --- a/vendor/github.com/containers/image/manifest/manifest.go +++ b/vendor/github.com/containers/image/manifest/manifest.go @@ -35,7 +35,7 @@ var DefaultRequestedManifestMIMETypes = []string{ DockerV2Schema2MediaType, DockerV2Schema1SignedMediaType, DockerV2Schema1MediaType, - DockerV2ListMediaType, + // DockerV2ListMediaType, // FIXME: Restore this ASAP } // GuessMIMEType guesses MIME type of a manifest and returns it _if it is recognized_, or "" if unknown or unrecognized. diff --git a/vendor/github.com/containers/image/ostree/ostree_dest.go b/vendor/github.com/containers/image/ostree/ostree_dest.go index f03ef65a..885297bd 100644 --- a/vendor/github.com/containers/image/ostree/ostree_dest.go +++ b/vendor/github.com/containers/image/ostree/ostree_dest.go @@ -153,7 +153,7 @@ func fixFiles(dir string, usermode bool) error { if err != nil { return err } - } else if usermode && (info.Mode().IsRegular() || (info.Mode()&os.ModeSymlink) != 0) { + } else if usermode && (info.Mode().IsRegular()) { if err := os.Chmod(fullpath, info.Mode()|0600); err != nil { return err } diff --git a/vendor/github.com/containers/image/ostree/ostree_transport.go b/vendor/github.com/containers/image/ostree/ostree_transport.go index 4bc4bd13..0de74a71 100644 --- a/vendor/github.com/containers/image/ostree/ostree_transport.go +++ b/vendor/github.com/containers/image/ostree/ostree_transport.go @@ -84,24 +84,15 @@ func NewReference(image string, repo string) (types.ImageReference, error) { // image is not _really_ in a containers/image/docker/reference format; // as far as the libOSTree ociimage/* namespace is concerned, it is more or // less an arbitrary string with an implied tag. - // We use the reference.* parsers basically for the default tag name in - // reference.TagNameOnly, and incidentally for some character set and length - // restrictions. - var ostreeImage reference.Named - s := strings.SplitN(image, ":", 2) - - named, err := reference.WithName(s[0]) + // Parse the image using reference.ParseNormalizedNamed so that we can + // check whether the images has a tag specified and we can add ":latest" if needed + ostreeImage, err := reference.ParseNormalizedNamed(image) if err != nil { return nil, err } - if len(s) == 1 { - ostreeImage = reference.TagNameOnly(named) - } else { - ostreeImage, err = reference.WithTag(named, s[1]) - if err != nil { - return nil, err - } + if reference.IsNameOnly(ostreeImage) { + image = image + ":latest" } resolved, err := explicitfilepath.ResolvePathToFullyExplicit(repo) @@ -123,8 +114,8 @@ func NewReference(image string, repo string) (types.ImageReference, error) { } return ostreeReference{ - image: ostreeImage.String(), - branchName: encodeOStreeRef(ostreeImage.String()), + image: image, + branchName: encodeOStreeRef(image), repo: resolved, }, nil } diff --git a/vendor/github.com/containers/image/types/types.go b/vendor/github.com/containers/image/types/types.go index a7cf49c0..a0424106 100644 --- a/vendor/github.com/containers/image/types/types.go +++ b/vendor/github.com/containers/image/types/types.go @@ -302,6 +302,8 @@ type SystemContext struct { SignaturePolicyPath string // If not "", overrides the system's default path for registries.d (Docker signature storage configuration) RegistriesDirPath string + // Path to the system-wide registries configuration file + SystemRegistriesConfPath string // === docker.Transport overrides === // If not "", a directory containing a CA certificate (ending with ".crt"), From 75dc703d6a576db712b571e500f84e9f6f608190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Wed, 13 Sep 2017 18:06:27 +0200 Subject: [PATCH 2/2] Mark TestCopyFailsWithManifestList with ExpectFailure This is one of the trade-offs we made. --- integration/copy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/integration/copy_test.go b/integration/copy_test.go index 34127737..95e939bb 100644 --- a/integration/copy_test.go +++ b/integration/copy_test.go @@ -90,6 +90,7 @@ func (s *CopySuite) TearDownSuite(c *check.C) { } func (s *CopySuite) TestCopyFailsWithManifestList(c *check.C) { + c.ExpectFailure("manifest-list-hotfix sacrificed hotfixes for being able to copy images") assertSkopeoFails(c, ".*can not copy docker://estesp/busybox:latest: manifest contains multiple images.*", "copy", "docker://estesp/busybox:latest", "dir:somedir") }