File: 0003-Bring-mediaType-out-of-reserved-status.patch

package info (click to toggle)
containerd 1.5.8~ds1-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 16,548 kB
  • sloc: sh: 717; makefile: 395
file content (71 lines) | stat: -rw-r--r-- 2,696 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From: Sebastiaan van Stijn <github@gone.nl>
Date: Thu, 18 Nov 2021 00:44:55 +0100
Subject: Bring mediaType out of reserved status

Origin: backport, https://github.com/containerd/containerd/pull/6264
---
 go.mod                      | 2 +-
 images/converter/default.go | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/go.mod b/go.mod
index 106cbd3..fe51707 100644
--- a/go.mod
+++ b/go.mod
@@ -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
diff --git a/images/converter/default.go b/images/converter/default.go
index 13dd513..1ff4b4d 100644
--- a/images/converter/default.go
+++ b/images/converter/default.go
@@ -117,7 +117,7 @@ func (c *defaultConverter) convertLayer(ctx context.Context, cs content.Store, d
 // - 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)
@@ -199,7 +199,7 @@ func (c *defaultConverter) convertManifest(ctx context.Context, cs content.Store
 // - 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)
@@ -349,6 +349,7 @@ 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
@@ -356,15 +357,15 @@ type ObjectWithMediaType struct {
 }
 
 // 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.