Skip to content

Commit fc81384

Browse files
committed
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 09c9270, depends on MediaTypes that have not yet been released by the OCI image-spec, so using current "main" instead. full diff: https://github.com/opencontainers/image-space/compare/5ad6f50d6283...693428a734f5 Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent a04656c commit fc81384

9 files changed

Lines changed: 23 additions & 19 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require (
4242
github.com/moby/sys/signal v0.6.0
4343
github.com/moby/sys/symlink v0.2.0
4444
github.com/opencontainers/go-digest v1.0.0
45-
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283
45+
github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5
4646
github.com/opencontainers/runc v1.0.3
4747
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
4848
github.com/opencontainers/selinux v1.8.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+t
473473
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
474474
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
475475
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
476-
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283 h1:TVzvdjOalkJBNkbpPVMAr4KV9QRf2IjfxdyxwAK78Gs=
477-
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
476+
github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 h1:q37d91F6BO4Jp1UqWiun0dUFYaqv6WsKTLTCaWv+8LY=
477+
github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
478478
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
479479
github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k=
480480
github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=

images/converter/default.go

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,11 @@ func (c *defaultConverter) convertLayer(ctx context.Context, cs content.Store, d
144144

145145
// convertManifest converts image manifests.
146146
//
147-
// - clears `.mediaType` if the target format is OCI
148-
//
147+
// - converts `.mediaType` if the target format is OCI
149148
// - records diff ID changes in c.diffIDMap
150149
func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
151150
var (
152-
manifest DualManifest
151+
manifest ocispec.Manifest
153152
modified bool
154153
)
155154
labels, err := readJSON(ctx, cs, &manifest, desc)
@@ -160,7 +159,7 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store
160159
labels = make(map[string]string)
161160
}
162161
if images.IsDockerType(manifest.MediaType) && c.docker2oci {
163-
manifest.MediaType = ""
162+
manifest.MediaType = ConvertDockerMediaTypeToOCI(manifest.MediaType)
164163
modified = true
165164
}
166165
var mu sync.Mutex
@@ -226,12 +225,11 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store
226225

227226
// convertIndex converts image index.
228227
//
229-
// - clears `.mediaType` if the target format is OCI
230-
//
228+
// - converts `.mediaType` if the target format is OCI
231229
// - clears manifest entries that do not match c.platformMC
232230
func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
233231
var (
234-
index DualIndex
232+
index ocispec.Index
235233
modified bool
236234
)
237235
labels, err := readJSON(ctx, cs, &index, desc)
@@ -242,7 +240,7 @@ func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, d
242240
labels = make(map[string]string)
243241
}
244242
if images.IsDockerType(index.MediaType) && c.docker2oci {
245-
index.MediaType = ""
243+
index.MediaType = ConvertDockerMediaTypeToOCI(index.MediaType)
246244
modified = true
247245
}
248246

@@ -381,22 +379,22 @@ func clearDockerV1DummyID(cfg DualConfig) (bool, error) {
381379
}
382380

383381
// ObjectWithMediaType represents an object with a MediaType field
382+
// Deprecated
384383
type ObjectWithMediaType struct {
385384
// MediaType appears on Docker manifests and manifest lists.
386-
// MediaType does not appear on OCI manifests and index
387385
MediaType string `json:"mediaType,omitempty"`
388386
}
389387

390388
// DualManifest covers Docker manifest and OCI manifest
389+
// Deprecated: use github.com/opencontainers/image-spec/specs-go/v1.Manifest
391390
type DualManifest struct {
392391
ocispec.Manifest
393-
ObjectWithMediaType
394392
}
395393

396394
// DualIndex covers Docker manifest list and OCI index
395+
// Deprecated: use github.com/opencontainers/image-spec/specs-go/v1.Index
397396
type DualIndex struct {
398397
ocispec.Index
399-
ObjectWithMediaType
400398
}
401399

402400
// DualConfig covers Docker config (v1.0, v1.1, v1.2) and OCI config.

integration/client/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/containerd/typeurl v1.0.2
1515
github.com/gogo/protobuf v1.3.2
1616
github.com/opencontainers/go-digest v1.0.0
17-
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283
17+
github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5
1818
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
1919
github.com/pkg/errors v0.9.1
2020
github.com/sirupsen/logrus v1.8.1

integration/client/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,8 @@ github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+t
443443
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
444444
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
445445
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
446-
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283 h1:TVzvdjOalkJBNkbpPVMAr4KV9QRf2IjfxdyxwAK78Gs=
447-
github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
446+
github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5 h1:q37d91F6BO4Jp1UqWiun0dUFYaqv6WsKTLTCaWv+8LY=
447+
github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
448448
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
449449
github.com/opencontainers/runc v1.0.3 h1:1hbqejyQWCJBvtKAfdO0b1FmaEf2z/bxnjqbARass5k=
450450
github.com/opencontainers/runc v1.0.3/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=

vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/opencontainers/image-spec/specs-go/version.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/modules.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ github.com/modern-go/reflect2
306306
## explicit
307307
github.com/opencontainers/go-digest
308308
github.com/opencontainers/go-digest/digestset
309-
# github.com/opencontainers/image-spec v1.0.2-0.20210819154149-5ad6f50d6283
309+
# github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5
310310
## explicit
311311
github.com/opencontainers/image-spec/identity
312312
github.com/opencontainers/image-spec/specs-go

0 commit comments

Comments
 (0)