go.mod: update image-spec to latest (v1.0.3-dev)

The OCI image spec did a v1.0.2 security release for CVE-2021-41190, however
commit 09c9270fee, depends on MediaTypes that
have not yet been released by the OCI image-spec, so using current "main" instead.

full diff: 5ad6f50d62...693428a734

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-11-18 00:39:12 +01:00
parent a04656c1dd
commit fc8138468f
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
9 changed files with 23 additions and 19 deletions

2
go.mod
View File

@ -42,7 +42,7 @@ require (
github.com/moby/sys/signal v0.6.0 github.com/moby/sys/signal v0.6.0
github.com/moby/sys/symlink v0.2.0 github.com/moby/sys/symlink v0.2.0
github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283 github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5
github.com/opencontainers/runc v1.0.3 github.com/opencontainers/runc v1.0.3
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
github.com/opencontainers/selinux v1.8.2 github.com/opencontainers/selinux v1.8.2

4
go.sum
View File

@ -473,8 +473,8 @@ github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+t
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= 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/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283 h1:TVzvdjOalkJBNkbpPVMAr4KV9QRf2IjfxdyxwAK78Gs= github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 h1:q37d91F6BO4Jp1UqWiun0dUFYaqv6WsKTLTCaWv+8LY=
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k= github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k=
github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=

View File

@ -144,12 +144,11 @@ func (c *defaultConverter) convertLayer(ctx context.Context, cs content.Store, d
// convertManifest converts image manifests. // 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 // - records diff ID changes in c.diffIDMap
func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) { func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
var ( var (
manifest DualManifest manifest ocispec.Manifest
modified bool modified bool
) )
labels, err := readJSON(ctx, cs, &manifest, desc) labels, err := readJSON(ctx, cs, &manifest, desc)
@ -160,7 +159,7 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store
labels = make(map[string]string) labels = make(map[string]string)
} }
if images.IsDockerType(manifest.MediaType) && c.docker2oci { if images.IsDockerType(manifest.MediaType) && c.docker2oci {
manifest.MediaType = "" manifest.MediaType = ConvertDockerMediaTypeToOCI(manifest.MediaType)
modified = true modified = true
} }
var mu sync.Mutex var mu sync.Mutex
@ -226,12 +225,11 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store
// convertIndex converts image index. // 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 // - 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) { func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
var ( var (
index DualIndex index ocispec.Index
modified bool modified bool
) )
labels, err := readJSON(ctx, cs, &index, desc) labels, err := readJSON(ctx, cs, &index, desc)
@ -242,7 +240,7 @@ func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, d
labels = make(map[string]string) labels = make(map[string]string)
} }
if images.IsDockerType(index.MediaType) && c.docker2oci { if images.IsDockerType(index.MediaType) && c.docker2oci {
index.MediaType = "" index.MediaType = ConvertDockerMediaTypeToOCI(index.MediaType)
modified = true modified = true
} }
@ -381,22 +379,22 @@ func clearDockerV1DummyID(cfg DualConfig) (bool, error) {
} }
// ObjectWithMediaType represents an object with a MediaType field // ObjectWithMediaType represents an object with a MediaType field
// Deprecated
type ObjectWithMediaType struct { type ObjectWithMediaType struct {
// MediaType appears on Docker manifests and manifest lists. // MediaType appears on Docker manifests and manifest lists.
// MediaType does not appear on OCI manifests and index
MediaType string `json:"mediaType,omitempty"` MediaType string `json:"mediaType,omitempty"`
} }
// DualManifest covers Docker manifest and OCI manifest // DualManifest covers Docker manifest and OCI manifest
// Deprecated: use github.com/opencontainers/image-spec/specs-go/v1.Manifest
type DualManifest struct { type DualManifest struct {
ocispec.Manifest ocispec.Manifest
ObjectWithMediaType
} }
// DualIndex covers Docker manifest list and OCI index // DualIndex covers Docker manifest list and OCI index
// Deprecated: use github.com/opencontainers/image-spec/specs-go/v1.Index
type DualIndex struct { type DualIndex struct {
ocispec.Index ocispec.Index
ObjectWithMediaType
} }
// DualConfig covers Docker config (v1.0, v1.1, v1.2) and OCI config. // DualConfig covers Docker config (v1.0, v1.1, v1.2) and OCI config.

View File

@ -14,7 +14,7 @@ require (
github.com/containerd/typeurl v1.0.2 github.com/containerd/typeurl v1.0.2
github.com/gogo/protobuf v1.3.2 github.com/gogo/protobuf v1.3.2
github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283 github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1 github.com/sirupsen/logrus v1.8.1

View File

@ -443,8 +443,8 @@ github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+t
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= 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/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283 h1:TVzvdjOalkJBNkbpPVMAr4KV9QRf2IjfxdyxwAK78Gs= github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 h1:q37d91F6BO4Jp1UqWiun0dUFYaqv6WsKTLTCaWv+8LY=
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k= github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k=
github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=

View File

@ -21,6 +21,9 @@ import "github.com/opencontainers/image-spec/specs-go"
type Index struct { type Index struct {
specs.Versioned specs.Versioned
// MediaType specificies the type of this document data structure e.g. `application/vnd.oci.image.index.v1+json`
MediaType string `json:"mediaType,omitempty"`
// Manifests references platform specific manifests. // Manifests references platform specific manifests.
Manifests []Descriptor `json:"manifests"` Manifests []Descriptor `json:"manifests"`

View File

@ -20,6 +20,9 @@ import "github.com/opencontainers/image-spec/specs-go"
type Manifest struct { type Manifest struct {
specs.Versioned specs.Versioned
// MediaType specificies the type of this document data structure e.g. `application/vnd.oci.image.manifest.v1+json`
MediaType string `json:"mediaType,omitempty"`
// Config references a configuration object for a container, by digest. // Config references a configuration object for a container, by digest.
// The referenced configuration object is a JSON blob that the runtime uses to set up the container. // The referenced configuration object is a JSON blob that the runtime uses to set up the container.
Config Descriptor `json:"config"` Config Descriptor `json:"config"`

View File

@ -22,7 +22,7 @@ const (
// VersionMinor is for functionality in a backwards-compatible manner // VersionMinor is for functionality in a backwards-compatible manner
VersionMinor = 0 VersionMinor = 0
// VersionPatch is for backwards-compatible bug fixes // VersionPatch is for backwards-compatible bug fixes
VersionPatch = 1 VersionPatch = 2
// VersionDev indicates development branch. Releases will be empty string. // VersionDev indicates development branch. Releases will be empty string.
VersionDev = "-dev" VersionDev = "-dev"

2
vendor/modules.txt vendored
View File

@ -306,7 +306,7 @@ github.com/modern-go/reflect2
## explicit ## explicit
github.com/opencontainers/go-digest github.com/opencontainers/go-digest
github.com/opencontainers/go-digest/digestset github.com/opencontainers/go-digest/digestset
# github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283 # github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5
## explicit ## explicit
github.com/opencontainers/image-spec/identity github.com/opencontainers/image-spec/identity
github.com/opencontainers/image-spec/specs-go github.com/opencontainers/image-spec/specs-go