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
9 changed files with 23 additions and 19 deletions

View File

@@ -144,12 +144,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)
@@ -160,7 +159,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
@@ -226,12 +225,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)
@@ -242,7 +240,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
}
@@ -381,22 +379,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.