Skip to content

Commit e7d4349

Browse files
authored
Merge pull request #6264 from thaJeztah/1.5_bump_oci_spec
[release/1.5] go.mod github.com/opencontainers/image-spec v1.0.2
2 parents f1c26fe + 7ab5252 commit e7d4349

File tree

9 files changed

+23
-17
lines changed

9 files changed

+23
-17
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ require (
3939
github.com/moby/sys/mountinfo v0.4.1
4040
github.com/moby/sys/symlink v0.1.0
4141
github.com/opencontainers/go-digest v1.0.0
42-
github.com/opencontainers/image-spec v1.0.1
42+
github.com/opencontainers/image-spec v1.0.2
4343
github.com/opencontainers/runc v1.0.2
4444
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
4545
github.com/opencontainers/selinux v1.8.2

go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,9 @@ github.com/onsi/gomega v1.10.3 h1:gph6h/qe9GSUw1NhH1gp+qb+h8rXD8Cy60Z32Qw3ELA=
348348
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
349349
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
350350
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
351-
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
352351
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
352+
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
353+
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
353354
github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg=
354355
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
355356
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=

images/converter/default.go

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

113113
// convertManifest converts image manifests.
114114
//
115-
// - clears `.mediaType` if the target format is OCI
116-
//
115+
// - converts `.mediaType` if the target format is OCI
117116
// - records diff ID changes in c.diffIDMap
118117
func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
119118
var (
120-
manifest DualManifest
119+
manifest ocispec.Manifest
121120
modified bool
122121
)
123122
labels, err := readJSON(ctx, cs, &manifest, desc)
@@ -128,7 +127,7 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store
128127
labels = make(map[string]string)
129128
}
130129
if images.IsDockerType(manifest.MediaType) && c.docker2oci {
131-
manifest.MediaType = ""
130+
manifest.MediaType = ConvertDockerMediaTypeToOCI(manifest.MediaType)
132131
modified = true
133132
}
134133
var mu sync.Mutex
@@ -194,12 +193,11 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store
194193

195194
// convertIndex converts image index.
196195
//
197-
// - clears `.mediaType` if the target format is OCI
198-
//
196+
// - converts `.mediaType` if the target format is OCI
199197
// - clears manifest entries that do not match c.platformMC
200198
func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
201199
var (
202-
index DualIndex
200+
index ocispec.Index
203201
modified bool
204202
)
205203
labels, err := readJSON(ctx, cs, &index, desc)
@@ -210,7 +208,7 @@ func (c *defaultConverter) convertIndex(ctx context.Context, cs content.Store, d
210208
labels = make(map[string]string)
211209
}
212210
if images.IsDockerType(index.MediaType) && c.docker2oci {
213-
index.MediaType = ""
211+
index.MediaType = ConvertDockerMediaTypeToOCI(index.MediaType)
214212
modified = true
215213
}
216214

@@ -349,22 +347,22 @@ func clearDockerV1DummyID(cfg DualConfig) (bool, error) {
349347
}
350348

351349
// ObjectWithMediaType represents an object with a MediaType field
350+
// Deprecated
352351
type ObjectWithMediaType struct {
353352
// MediaType appears on Docker manifests and manifest lists.
354-
// MediaType does not appear on OCI manifests and index
355353
MediaType string `json:"mediaType,omitempty"`
356354
}
357355

358356
// DualManifest covers Docker manifest and OCI manifest
357+
// Deprecated: use github.com/opencontainers/image-spec/specs-go/v1.Manifest
359358
type DualManifest struct {
360359
ocispec.Manifest
361-
ObjectWithMediaType
362360
}
363361

364362
// DualIndex covers Docker manifest list and OCI index
363+
// Deprecated: use github.com/opencontainers/image-spec/specs-go/v1.Index
365364
type DualIndex struct {
366365
ocispec.Index
367-
ObjectWithMediaType
368366
}
369367

370368
// 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
@@ -13,7 +13,7 @@ require (
1313
github.com/containerd/typeurl v1.0.2
1414
github.com/gogo/protobuf v1.3.2
1515
github.com/opencontainers/go-digest v1.0.0
16-
github.com/opencontainers/image-spec v1.0.1
16+
github.com/opencontainers/image-spec v1.0.2
1717
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
1818
github.com/pkg/errors v0.9.1
1919
github.com/sirupsen/logrus v1.8.1

integration/client/go.sum

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,9 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J
323323
github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc=
324324
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
325325
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
326-
github.com/opencontainers/image-spec v1.0.1 h1:JMemWkRwHx4Zj+fVxWoMCFm/8sYGGrUVojFA6h/TRcI=
327326
github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
327+
github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM=
328+
github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0=
328329
github.com/opencontainers/runc v1.0.2 h1:opHZMaswlyxz1OuGpBE53Dwe4/xF7EZTY0A2L/FpCOg=
329330
github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0=
330331
github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=

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
@@ -265,7 +265,7 @@ github.com/modern-go/reflect2
265265
## explicit
266266
github.com/opencontainers/go-digest
267267
github.com/opencontainers/go-digest/digestset
268-
# github.com/opencontainers/image-spec v1.0.1
268+
# github.com/opencontainers/image-spec v1.0.2
269269
## explicit
270270
github.com/opencontainers/image-spec/identity
271271
github.com/opencontainers/image-spec/specs-go

0 commit comments

Comments
 (0)