Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/1.5] go.mod github.com/opencontainers/image-spec v1.0.2 #6264

Merged
merged 1 commit into from Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -39,7 +39,7 @@ require (
github.com/moby/sys/mountinfo v0.4.1
github.com/moby/sys/symlink v0.1.0
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/image-spec v1.0.2
github.com/opencontainers/runc v1.0.2
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
github.com/opencontainers/selinux v1.8.2
Expand Down
3 changes: 2 additions & 1 deletion go.sum
Expand Up @@ -348,8 +348,9 @@ github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA=
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg=
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
Expand Down
20 changes: 9 additions & 11 deletions images/converter/default.go
Expand Up @@ -112,12 +112,11 @@ func (c *defaultConverter) convertLayer(ctx context.Context, cs content.Store, d

// convertManifest converts image manifests.
//
// - clears `.mediaType` if the target format is OCI
//
// - converts `.mediaType` if the target format is OCI
// - records diff ID changes in c.diffIDMap
func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
var (
manifest DualManifest
manifest ocispec.Manifest
modified bool
)
labels, err := readJSON(ctx, cs, &manifest, desc)
Expand All @@ -128,7 +127,7 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store
labels = make(map[string]string)
}
if images.IsDockerType(manifest.MediaType) && c.docker2oci {
manifest.MediaType = ""
manifest.MediaType = ConvertDockerMediaTypeToOCI(manifest.MediaType)
modified = true
}
var mu sync.Mutex
Expand Down Expand Up @@ -194,12 +193,11 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store

// convertIndex converts image index.
//
// - clears `.mediaType` if the target format is OCI
//
// - converts `.mediaType` if the target format is OCI
// - clears manifest entries that do not match c.platformMC
func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
var (
index DualIndex
index ocispec.Index
modified bool
)
labels, err := readJSON(ctx, cs, &index, desc)
Expand All @@ -210,7 +208,7 @@ func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, d
labels = make(map[string]string)
}
if images.IsDockerType(index.MediaType) && c.docker2oci {
index.MediaType = ""
index.MediaType = ConvertDockerMediaTypeToOCI(index.MediaType)
modified = true
}

Expand Down Expand Up @@ -349,22 +347,22 @@ func clearDockerV1DummyID(cfg DualConfig) (bool, error) {
}

// ObjectWithMediaType represents an object with a MediaType field
// Deprecated
type ObjectWithMediaType struct {
// MediaType appears on Docker manifests and manifest lists.
// MediaType does not appear on OCI manifests and index
MediaType string `json:"mediaType,omitempty"`
}

// DualManifest covers Docker manifest and OCI manifest
// Deprecated: use github.com/opencontainers/image-spec/specs-go/v1.Manifest
type DualManifest struct {
ocispec.Manifest
ObjectWithMediaType
}

// DualIndex covers Docker manifest list and OCI index
// Deprecated: use github.com/opencontainers/image-spec/specs-go/v1.Index
type DualIndex struct {
ocispec.Index
ObjectWithMediaType
}

// DualConfig covers Docker config (v1.0, v1.1, v1.2) and OCI config.
Expand Down
2 changes: 1 addition & 1 deletion integration/client/go.mod
Expand Up @@ -13,7 +13,7 @@ require (
github.com/containerd/typeurl v1.0.2
github.com/gogo/protobuf v1.3.2
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/image-spec v1.0.2
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
Expand Down
3 changes: 2 additions & 1 deletion integration/client/go.sum
Expand Up @@ -323,8 +323,9 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg=
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Expand Up @@ -265,7 +265,7 @@ github.com/modern-go/reflect2
## explicit
github.com/opencontainers/go-digest
github.com/opencontainers/go-digest/digestset
# github.com/opencontainers/image-spec v1.0.1
# github.com/opencontainers/image-spec v1.0.2
## explicit
github.com/opencontainers/image-spec/identity
github.com/opencontainers/image-spec/specs-go
Expand Down