Browse code

Merge pull request #37355 from tonistiigi/vendor-containerd

vendor: update containerd to 08f7ee98

Tibor Vass authored on 2018/06/28 07:08:22
Showing 6 changed files
... ...
@@ -114,7 +114,7 @@ github.com/googleapis/gax-go v2.0.0
114 114
 google.golang.org/genproto 694d95ba50e67b2e363f3483057db5d4910c18f9
115 115
 
116 116
 # containerd
117
-github.com/containerd/containerd 63522d9eaa5a0443d225642c4b6f4f5fdedf932b
117
+github.com/containerd/containerd 08f7ee9828af1783dc98cc5cc1739e915697c667
118 118
 github.com/containerd/fifo 3d5202aec260678c48179c56f40e6f38a095738c
119 119
 github.com/containerd/continuity d3c23511c1bf5851696cba83143d9cbcd666869b
120 120
 github.com/containerd/cgroups fe281dd265766145e943a034aa41086474ea6130
... ...
@@ -129,11 +129,14 @@ func (image *Image) Size(ctx context.Context, provider content.Provider, platfor
129 129
 // this direction because this abstraction is not needed.`
130 130
 func Manifest(ctx context.Context, provider content.Provider, image ocispec.Descriptor, platform string) (ocispec.Manifest, error) {
131 131
 	var (
132
-		matcher platforms.Matcher
133
-		m       *ocispec.Manifest
132
+		matcher  platforms.Matcher
133
+		m        *ocispec.Manifest
134
+		p        ocispec.Platform
135
+		wasIndex bool
134 136
 	)
135 137
 	if platform != "" {
136
-		p, err := platforms.Parse(platform)
138
+		var err error
139
+		p, err = platforms.Parse(platform)
137 140
 		if err != nil {
138 141
 			return ocispec.Manifest{}, err
139 142
 		}
... ...
@@ -201,6 +204,8 @@ func Manifest(ctx context.Context, provider content.Provider, image ocispec.Desc
201 201
 				}
202 202
 			}
203 203
 
204
+			wasIndex = true
205
+
204 206
 			return descs, nil
205 207
 
206 208
 		}
... ...
@@ -210,7 +215,11 @@ func Manifest(ctx context.Context, provider content.Provider, image ocispec.Desc
210 210
 	}
211 211
 
212 212
 	if m == nil {
213
-		return ocispec.Manifest{}, errors.Wrapf(errdefs.ErrNotFound, "manifest %v", image.Digest)
213
+		err := errors.Wrapf(errdefs.ErrNotFound, "manifest %v", image.Digest)
214
+		if wasIndex {
215
+			err = errors.Wrapf(errdefs.ErrNotFound, "no match for current platform %s in manifest %v", platforms.Format(p), image.Digest)
216
+		}
217
+		return ocispec.Manifest{}, err
214 218
 	}
215 219
 
216 220
 	return *m, nil
... ...
@@ -89,18 +89,21 @@ func normalizeArch(arch, variant string) (string, string) {
89 89
 	case "x86_64", "x86-64":
90 90
 		arch = "amd64"
91 91
 		variant = ""
92
-	case "aarch64":
92
+	case "aarch64", "arm64":
93 93
 		arch = "arm64"
94
-		variant = "" // v8 is implied
94
+		switch variant {
95
+		case "8", "v8":
96
+			variant = ""
97
+		}
95 98
 	case "armhf":
96 99
 		arch = "arm"
97
-		variant = ""
100
+		variant = "v7"
98 101
 	case "armel":
99 102
 		arch = "arm"
100 103
 		variant = "v6"
101 104
 	case "arm":
102 105
 		switch variant {
103
-		case "v7", "7":
106
+		case "", "7":
104 107
 			variant = "v7"
105 108
 		case "5", "6", "8":
106 109
 			variant = "v" + variant
... ...
@@ -135,7 +135,7 @@ type Matcher interface {
135 135
 // Applications should opt to use `Match` over directly parsing specifiers.
136 136
 func NewMatcher(platform specs.Platform) Matcher {
137 137
 	return &matcher{
138
-		Platform: platform,
138
+		Platform: Normalize(platform),
139 139
 	}
140 140
 }
141 141
 
... ...
@@ -197,6 +197,9 @@ func Parse(specifier string) (specs.Platform, error) {
197 197
 		}
198 198
 
199 199
 		p.Architecture, p.Variant = normalizeArch(parts[0], "")
200
+		if p.Architecture == "arm" && p.Variant == "v7" {
201
+			p.Variant = ""
202
+		}
200 203
 		if isKnownArch(p.Architecture) {
201 204
 			p.OS = runtime.GOOS
202 205
 			return p, nil
... ...
@@ -208,12 +211,18 @@ func Parse(specifier string) (specs.Platform, error) {
208 208
 		// about whether or not we know of the platform.
209 209
 		p.OS = normalizeOS(parts[0])
210 210
 		p.Architecture, p.Variant = normalizeArch(parts[1], "")
211
+		if p.Architecture == "arm" && p.Variant == "v7" {
212
+			p.Variant = ""
213
+		}
211 214
 
212 215
 		return p, nil
213 216
 	case 3:
214 217
 		// we have a fully specified variant, this is rare
215 218
 		p.OS = normalizeOS(parts[0])
216 219
 		p.Architecture, p.Variant = normalizeArch(parts[1], parts[2])
220
+		if p.Architecture == "arm64" && p.Variant == "" {
221
+			p.Variant = "v8"
222
+		}
217 223
 
218 224
 		return p, nil
219 225
 	}
... ...
@@ -136,6 +136,7 @@ func newCommand(binary, daemonAddress string, debug bool, config shim.Config, so
136 136
 	// will be mounted by the shim
137 137
 	cmd.SysProcAttr = getSysProcAttr()
138 138
 	cmd.ExtraFiles = append(cmd.ExtraFiles, socket)
139
+	cmd.Env = append(os.Environ(), "GOMAXPROCS=2")
139 140
 	if debug {
140 141
 		cmd.Stdout = os.Stdout
141 142
 		cmd.Stderr = os.Stderr
... ...
@@ -22,7 +22,6 @@ github.com/golang/protobuf v1.1.0
22 22
 github.com/opencontainers/runtime-spec v1.0.1
23 23
 github.com/opencontainers/runc 69663f0bd4b60df09991c08812a60108003fa340
24 24
 github.com/sirupsen/logrus v1.0.0
25
-github.com/pmezard/go-difflib v1.0.0
26 25
 github.com/urfave/cli 7bc6a0acffa589f415f88aca16cc1de5ffd66f9c
27 26
 golang.org/x/net b3756b4b77d7b13260a0a2ec658753cf48922eac
28 27
 google.golang.org/grpc v1.12.0
... ...
@@ -40,7 +39,7 @@ google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
40 40
 golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
41 41
 github.com/stevvooe/ttrpc d4528379866b0ce7e9d71f3eb96f0582fc374577
42 42
 github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
43
-github.com/gotestyourself/gotestyourself 44dbf532bbf5767611f6f2a61bded572e337010a
43
+gotest.tools v2.1.0
44 44
 github.com/google/go-cmp v0.1.0
45 45
 
46 46
 github.com/containerd/cri 8bcb9a95394e8d7845da1d6a994d3ac2a86d22f0