v1.4.0-beta.1-150-g779ef602
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
| ... | ... |
@@ -122,8 +122,8 @@ github.com/googleapis/gax-go 317e0006254c44a0ac427cc52a0e |
| 122 | 122 |
google.golang.org/genproto 3f1135a288c9a07e340ae8ba4cc6c7065a3160e8 |
| 123 | 123 |
|
| 124 | 124 |
# containerd |
| 125 |
-github.com/containerd/containerd c80284d4b5291a351bb471bcdabb5c1d95e7a583 # master / v1.4.0-dev |
|
| 126 |
-github.com/containerd/fifo ff969a566b00877c63489baf6e8c35d60af6142c |
|
| 125 |
+github.com/containerd/containerd 779ef60231a555f7eb9ba82b052d59b69ca2ef10 # master / v1.4.0-beta.1-150-g779ef602 |
|
| 126 |
+github.com/containerd/fifo f15a3290365b9d2627d189e619ab4008e0069caf |
|
| 127 | 127 |
github.com/containerd/continuity efbc4488d8fe1bdc16bde3b2d2990d9b3a899165 |
| 128 | 128 |
github.com/containerd/cgroups 318312a373405e5e91134d8063d04d59768a1bff |
| 129 | 129 |
github.com/containerd/console 8375c3424e4d7b114e8a90a4a40c8e1b40d1d4e6 # v1.0.0 |
| ... | ... |
@@ -154,7 +154,7 @@ Taking a container object and turning it into a runnable process on a system is |
| 154 | 154 |
|
| 155 | 155 |
```go |
| 156 | 156 |
// create a new task |
| 157 |
-task, err := redis.NewTask(context, cio.Stdio) |
|
| 157 |
+task, err := redis.NewTask(context, cio.NewCreator(cio.WithStdio)) |
|
| 158 | 158 |
defer task.Delete(context) |
| 159 | 159 |
|
| 160 | 160 |
// the task is now running and has a pid that can be use to setup networking |
| ... | ... |
@@ -184,7 +184,7 @@ checkpoint, err := client.Pull(context, "myregistry/checkpoints/redis:master") |
| 184 | 184 |
redis, err = client.NewContainer(context, "redis-master", containerd.WithNewSnapshot("redis-rootfs", checkpoint))
|
| 185 | 185 |
defer container.Delete(context) |
| 186 | 186 |
|
| 187 |
-task, err = redis.NewTask(context, cio.Stdio, containerd.WithTaskCheckpoint(checkpoint)) |
|
| 187 |
+task, err = redis.NewTask(context, cio.NewCreator(cio.WithStdio), containerd.WithTaskCheckpoint(checkpoint)) |
|
| 188 | 188 |
defer task.Delete(context) |
| 189 | 189 |
|
| 190 | 190 |
err := task.Start(context) |
| ... | ... |
@@ -245,19 +245,11 @@ func LogURI(uri *url.URL) Creator {
|
| 245 | 245 |
// BinaryIO forwards container STDOUT|STDERR directly to a logging binary |
| 246 | 246 |
func BinaryIO(binary string, args map[string]string) Creator {
|
| 247 | 247 |
return func(_ string) (IO, error) {
|
| 248 |
- binary = filepath.Clean(binary) |
|
| 249 |
- if !strings.HasPrefix(binary, "/") {
|
|
| 250 |
- return nil, errors.New("absolute path needed")
|
|
| 251 |
- } |
|
| 252 |
- uri := &url.URL{
|
|
| 253 |
- Scheme: "binary", |
|
| 254 |
- Path: binary, |
|
| 255 |
- } |
|
| 256 |
- q := uri.Query() |
|
| 257 |
- for k, v := range args {
|
|
| 258 |
- q.Set(k, v) |
|
| 248 |
+ uri, err := LogURIGenerator("binary", binary, args)
|
|
| 249 |
+ if err != nil {
|
|
| 250 |
+ return nil, err |
|
| 259 | 251 |
} |
| 260 |
- uri.RawQuery = q.Encode() |
|
| 252 |
+ |
|
| 261 | 253 |
res := uri.String() |
| 262 | 254 |
return &logURI{
|
| 263 | 255 |
config: Config{
|
| ... | ... |
@@ -272,14 +264,11 @@ func BinaryIO(binary string, args map[string]string) Creator {
|
| 272 | 272 |
// If the log file already exists, the logs will be appended to the file. |
| 273 | 273 |
func LogFile(path string) Creator {
|
| 274 | 274 |
return func(_ string) (IO, error) {
|
| 275 |
- path = filepath.Clean(path) |
|
| 276 |
- if !strings.HasPrefix(path, "/") {
|
|
| 277 |
- return nil, errors.New("absolute path needed")
|
|
| 278 |
- } |
|
| 279 |
- uri := &url.URL{
|
|
| 280 |
- Scheme: "file", |
|
| 281 |
- Path: path, |
|
| 275 |
+ uri, err := LogURIGenerator("file", path, nil)
|
|
| 276 |
+ if err != nil {
|
|
| 277 |
+ return nil, err |
|
| 282 | 278 |
} |
| 279 |
+ |
|
| 283 | 280 |
res := uri.String() |
| 284 | 281 |
return &logURI{
|
| 285 | 282 |
config: Config{
|
| ... | ... |
@@ -290,6 +279,30 @@ func LogFile(path string) Creator {
|
| 290 | 290 |
} |
| 291 | 291 |
} |
| 292 | 292 |
|
| 293 |
+// LogURIGenerator is the helper to generate log uri with specific scheme. |
|
| 294 |
+func LogURIGenerator(scheme string, path string, args map[string]string) (*url.URL, error) {
|
|
| 295 |
+ path = filepath.Clean(path) |
|
| 296 |
+ if !strings.HasPrefix(path, "/") {
|
|
| 297 |
+ return nil, errors.New("absolute path needed")
|
|
| 298 |
+ } |
|
| 299 |
+ |
|
| 300 |
+ uri := &url.URL{
|
|
| 301 |
+ Scheme: scheme, |
|
| 302 |
+ Path: path, |
|
| 303 |
+ } |
|
| 304 |
+ |
|
| 305 |
+ if len(args) == 0 {
|
|
| 306 |
+ return uri, nil |
|
| 307 |
+ } |
|
| 308 |
+ |
|
| 309 |
+ q := uri.Query() |
|
| 310 |
+ for k, v := range args {
|
|
| 311 |
+ q.Set(k, v) |
|
| 312 |
+ } |
|
| 313 |
+ uri.RawQuery = q.Encode() |
|
| 314 |
+ return uri, nil |
|
| 315 |
+} |
|
| 316 |
+ |
|
| 293 | 317 |
type logURI struct {
|
| 294 | 318 |
config Config |
| 295 | 319 |
} |
| ... | ... |
@@ -132,7 +132,7 @@ func openFifos(ctx context.Context, fifos *FIFOSet) (pipes, error) {
|
| 132 | 132 |
} |
| 133 | 133 |
}() |
| 134 | 134 |
} |
| 135 |
- if fifos.Stderr != "" {
|
|
| 135 |
+ if !fifos.Terminal && fifos.Stderr != "" {
|
|
| 136 | 136 |
if f.Stderr, err = fifo.OpenFifo(ctx, fifos.Stderr, syscall.O_RDONLY|syscall.O_CREAT|syscall.O_NONBLOCK, 0700); err != nil {
|
| 137 | 137 |
return f, errors.Wrapf(err, "failed to open stderr fifo") |
| 138 | 138 |
} |
| ... | ... |
@@ -351,6 +351,10 @@ type RemoteContext struct {
|
| 351 | 351 |
|
| 352 | 352 |
// AllMetadata downloads all manifests and known-configuration files |
| 353 | 353 |
AllMetadata bool |
| 354 |
+ |
|
| 355 |
+ // ChildLabelMap sets the labels used to reference child objects in the content |
|
| 356 |
+ // store. By default, all GC reference labels will be set for all fetched content. |
|
| 357 |
+ ChildLabelMap func(ocispec.Descriptor) []string |
|
| 354 | 358 |
} |
| 355 | 359 |
|
| 356 | 360 |
func defaultRemoteContext() *RemoteContext {
|
| ... | ... |
@@ -23,6 +23,7 @@ import ( |
| 23 | 23 |
"github.com/containerd/containerd/platforms" |
| 24 | 24 |
"github.com/containerd/containerd/remotes" |
| 25 | 25 |
"github.com/containerd/containerd/snapshots" |
| 26 |
+ ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
|
| 26 | 27 |
|
| 27 | 28 |
"google.golang.org/grpc" |
| 28 | 29 |
) |
| ... | ... |
@@ -175,6 +176,18 @@ func WithPullLabels(labels map[string]string) RemoteOpt {
|
| 175 | 175 |
} |
| 176 | 176 |
} |
| 177 | 177 |
|
| 178 |
+// WithChildLabelMap sets the map function used to define the labels set |
|
| 179 |
+// on referenced child content in the content store. This can be used |
|
| 180 |
+// to overwrite the default GC labels or filter which labels get set |
|
| 181 |
+// for content. |
|
| 182 |
+// The default is `images.ChildGCLabels`. |
|
| 183 |
+func WithChildLabelMap(fn func(ocispec.Descriptor) []string) RemoteOpt {
|
|
| 184 |
+ return func(_ *Client, c *RemoteContext) error {
|
|
| 185 |
+ c.ChildLabelMap = fn |
|
| 186 |
+ return nil |
|
| 187 |
+ } |
|
| 188 |
+} |
|
| 189 |
+ |
|
| 178 | 190 |
// WithSchema1Conversion is used to convert Docker registry schema 1 |
| 179 | 191 |
// manifests to oci manifests on pull. Without this option schema 1 |
| 180 | 192 |
// manifests will return a not supported error. |
| ... | ... |
@@ -290,6 +290,7 @@ func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...N |
| 290 | 290 |
client: c.client, |
| 291 | 291 |
io: i, |
| 292 | 292 |
id: c.id, |
| 293 |
+ c: c, |
|
| 293 | 294 |
} |
| 294 | 295 |
if info.Checkpoint != nil {
|
| 295 | 296 |
request.Checkpoint = info.Checkpoint |
| ... | ... |
@@ -407,6 +408,7 @@ func (c *container) loadTask(ctx context.Context, ioAttach cio.Attach) (Task, er |
| 407 | 407 |
io: i, |
| 408 | 408 |
id: response.Process.ID, |
| 409 | 409 |
pid: response.Process.Pid, |
| 410 |
+ c: c, |
|
| 410 | 411 |
} |
| 411 | 412 |
return t, nil |
| 412 | 413 |
} |
| ... | ... |
@@ -47,7 +47,7 @@ func arches() []specs.Arch {
|
| 47 | 47 |
} |
| 48 | 48 |
} |
| 49 | 49 |
|
| 50 |
-// DefaultProfile defines the whitelist for the default seccomp profile. |
|
| 50 |
+// DefaultProfile defines the allowed syscalls for the default seccomp profile. |
|
| 51 | 51 |
func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
| 52 | 52 |
syscalls := []specs.LinuxSyscall{
|
| 53 | 53 |
{
|
| ... | ... |
@@ -64,6 +64,8 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
| 64 | 64 |
"chmod", |
| 65 | 65 |
"chown", |
| 66 | 66 |
"chown32", |
| 67 |
+ "clock_adjtime", |
|
| 68 |
+ "clock_adjtime64", |
|
| 67 | 69 |
"clock_getres", |
| 68 | 70 |
"clock_getres_time64", |
| 69 | 71 |
"clock_gettime", |
| ... | ... |
@@ -253,6 +255,7 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
| 253 | 253 |
"renameat2", |
| 254 | 254 |
"restart_syscall", |
| 255 | 255 |
"rmdir", |
| 256 |
+ "rseq", |
|
| 256 | 257 |
"rt_sigaction", |
| 257 | 258 |
"rt_sigpending", |
| 258 | 259 |
"rt_sigprocmask", |
| ... | ... |
@@ -513,7 +516,6 @@ func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
| 513 | 513 |
"delete_module", |
| 514 | 514 |
"init_module", |
| 515 | 515 |
"finit_module", |
| 516 |
- "query_module", |
|
| 517 | 516 |
}, |
| 518 | 517 |
Action: specs.ActAllow, |
| 519 | 518 |
Args: []specs.LinuxSeccompArg{},
|
| ... | ... |
@@ -20,7 +20,7 @@ package seccomp |
| 20 | 20 |
|
| 21 | 21 |
import specs "github.com/opencontainers/runtime-spec/specs-go" |
| 22 | 22 |
|
| 23 |
-// DefaultProfile defines the whitelist for the default seccomp profile. |
|
| 23 |
+// DefaultProfile defines the allowed syscalls for the default seccomp profile. |
|
| 24 | 24 |
func DefaultProfile(sp *specs.Spec) *specs.LinuxSeccomp {
|
| 25 | 25 |
return &specs.LinuxSeccomp{}
|
| 26 | 26 |
} |
| ... | ... |
@@ -203,24 +203,26 @@ func (i *image) Usage(ctx context.Context, opts ...UsageOpt) (int64, error) {
|
| 203 | 203 |
desc.Size = info.Size |
| 204 | 204 |
} |
| 205 | 205 |
|
| 206 |
- for k, v := range info.Labels {
|
|
| 207 |
- const prefix = "containerd.io/gc.ref.snapshot." |
|
| 208 |
- if !strings.HasPrefix(k, prefix) {
|
|
| 209 |
- continue |
|
| 210 |
- } |
|
| 206 |
+ if config.snapshots {
|
|
| 207 |
+ for k, v := range info.Labels {
|
|
| 208 |
+ const prefix = "containerd.io/gc.ref.snapshot." |
|
| 209 |
+ if !strings.HasPrefix(k, prefix) {
|
|
| 210 |
+ continue |
|
| 211 |
+ } |
|
| 211 | 212 |
|
| 212 |
- sn := i.client.SnapshotService(k[len(prefix):]) |
|
| 213 |
- if sn == nil {
|
|
| 214 |
- continue |
|
| 215 |
- } |
|
| 213 |
+ sn := i.client.SnapshotService(k[len(prefix):]) |
|
| 214 |
+ if sn == nil {
|
|
| 215 |
+ continue |
|
| 216 |
+ } |
|
| 216 | 217 |
|
| 217 |
- u, err := sn.Usage(ctx, v) |
|
| 218 |
- if err != nil {
|
|
| 219 |
- if !errdefs.IsNotFound(err) && !errdefs.IsInvalidArgument(err) {
|
|
| 220 |
- return nil, err |
|
| 218 |
+ u, err := sn.Usage(ctx, v) |
|
| 219 |
+ if err != nil {
|
|
| 220 |
+ if !errdefs.IsNotFound(err) && !errdefs.IsInvalidArgument(err) {
|
|
| 221 |
+ return nil, err |
|
| 222 |
+ } |
|
| 223 |
+ } else {
|
|
| 224 |
+ usage += u.Size |
|
| 221 | 225 |
} |
| 222 |
- } else {
|
|
| 223 |
- usage += u.Size |
|
| 224 | 226 |
} |
| 225 | 227 |
} |
| 226 | 228 |
} |
| ... | ... |
@@ -170,6 +170,19 @@ func ChildrenHandler(provider content.Provider) HandlerFunc {
|
| 170 | 170 |
// the children returned by the handler and passes through the children. |
| 171 | 171 |
// Must follow a handler that returns the children to be labeled. |
| 172 | 172 |
func SetChildrenLabels(manager content.Manager, f HandlerFunc) HandlerFunc {
|
| 173 |
+ return SetChildrenMappedLabels(manager, f, nil) |
|
| 174 |
+} |
|
| 175 |
+ |
|
| 176 |
+// SetChildrenMappedLabels is a handler wrapper which sets labels for the content on |
|
| 177 |
+// the children returned by the handler and passes through the children. |
|
| 178 |
+// Must follow a handler that returns the children to be labeled. |
|
| 179 |
+// The label map allows the caller to control the labels per child descriptor. |
|
| 180 |
+// For returned labels, the index of the child will be appended to the end |
|
| 181 |
+// except for the first index when the returned label does not end with '.'. |
|
| 182 |
+func SetChildrenMappedLabels(manager content.Manager, f HandlerFunc, labelMap func(ocispec.Descriptor) []string) HandlerFunc {
|
|
| 183 |
+ if labelMap == nil {
|
|
| 184 |
+ labelMap = ChildGCLabels |
|
| 185 |
+ } |
|
| 173 | 186 |
return func(ctx context.Context, desc ocispec.Descriptor) ([]ocispec.Descriptor, error) {
|
| 174 | 187 |
children, err := f(ctx, desc) |
| 175 | 188 |
if err != nil {
|
| ... | ... |
@@ -177,14 +190,26 @@ func SetChildrenLabels(manager content.Manager, f HandlerFunc) HandlerFunc {
|
| 177 | 177 |
} |
| 178 | 178 |
|
| 179 | 179 |
if len(children) > 0 {
|
| 180 |
- info := content.Info{
|
|
| 181 |
- Digest: desc.Digest, |
|
| 182 |
- Labels: map[string]string{},
|
|
| 183 |
- } |
|
| 184 |
- fields := []string{}
|
|
| 185 |
- for i, ch := range children {
|
|
| 186 |
- info.Labels[fmt.Sprintf("containerd.io/gc.ref.content.%d", i)] = ch.Digest.String()
|
|
| 187 |
- fields = append(fields, fmt.Sprintf("labels.containerd.io/gc.ref.content.%d", i))
|
|
| 180 |
+ var ( |
|
| 181 |
+ info = content.Info{
|
|
| 182 |
+ Digest: desc.Digest, |
|
| 183 |
+ Labels: map[string]string{},
|
|
| 184 |
+ } |
|
| 185 |
+ fields = []string{}
|
|
| 186 |
+ keys = map[string]uint{}
|
|
| 187 |
+ ) |
|
| 188 |
+ for _, ch := range children {
|
|
| 189 |
+ labelKeys := labelMap(ch) |
|
| 190 |
+ for _, key := range labelKeys {
|
|
| 191 |
+ idx := keys[key] |
|
| 192 |
+ keys[key] = idx + 1 |
|
| 193 |
+ if idx > 0 || key[len(key)-1] == '.' {
|
|
| 194 |
+ key = fmt.Sprintf("%s%d", key, idx)
|
|
| 195 |
+ } |
|
| 196 |
+ |
|
| 197 |
+ info.Labels[key] = ch.Digest.String() |
|
| 198 |
+ fields = append(fields, "labels."+key) |
|
| 199 |
+ } |
|
| 188 | 200 |
} |
| 189 | 201 |
|
| 190 | 202 |
_, err := manager.Update(ctx, info, fields...) |
| ... | ... |
@@ -362,7 +362,7 @@ func Children(ctx context.Context, provider content.Provider, desc ocispec.Descr |
| 362 | 362 |
// childless data types. |
| 363 | 363 |
return nil, nil |
| 364 | 364 |
} |
| 365 |
- log.G(ctx).Warnf("encountered unknown type %v; children may not be fetched", desc.MediaType)
|
|
| 365 |
+ log.G(ctx).Debugf("encountered unknown type %v; children may not be fetched", desc.MediaType)
|
|
| 366 | 366 |
} |
| 367 | 367 |
|
| 368 | 368 |
return descs, nil |
| ... | ... |
@@ -23,6 +23,7 @@ import ( |
| 23 | 23 |
|
| 24 | 24 |
"github.com/containerd/containerd/errdefs" |
| 25 | 25 |
ocispec "github.com/opencontainers/image-spec/specs-go/v1" |
| 26 |
+ "github.com/pkg/errors" |
|
| 26 | 27 |
) |
| 27 | 28 |
|
| 28 | 29 |
// mediatype definitions for image components handled in containerd. |
| ... | ... |
@@ -81,7 +82,7 @@ func DiffCompression(ctx context.Context, mediaType string) (string, error) {
|
| 81 | 81 |
} |
| 82 | 82 |
return "", nil |
| 83 | 83 |
default: |
| 84 |
- return "", errdefs.ErrNotImplemented |
|
| 84 |
+ return "", errors.Wrapf(errdefs.ErrNotImplemented, "unrecognised mediatype %s", mediaType) |
|
| 85 | 85 |
} |
| 86 | 86 |
} |
| 87 | 87 |
|
| ... | ... |
@@ -124,3 +125,31 @@ func IsKnownConfig(mt string) bool {
|
| 124 | 124 |
} |
| 125 | 125 |
return false |
| 126 | 126 |
} |
| 127 |
+ |
|
| 128 |
+// ChildGCLabels returns the label for a given descriptor to reference it |
|
| 129 |
+func ChildGCLabels(desc ocispec.Descriptor) []string {
|
|
| 130 |
+ mt := desc.MediaType |
|
| 131 |
+ if IsKnownConfig(mt) {
|
|
| 132 |
+ return []string{"containerd.io/gc.ref.content.config"}
|
|
| 133 |
+ } |
|
| 134 |
+ |
|
| 135 |
+ switch mt {
|
|
| 136 |
+ case MediaTypeDockerSchema2Manifest, ocispec.MediaTypeImageManifest: |
|
| 137 |
+ return []string{"containerd.io/gc.ref.content.m."}
|
|
| 138 |
+ } |
|
| 139 |
+ |
|
| 140 |
+ if IsLayerType(mt) {
|
|
| 141 |
+ return []string{"containerd.io/gc.ref.content.l."}
|
|
| 142 |
+ } |
|
| 143 |
+ |
|
| 144 |
+ return []string{"containerd.io/gc.ref.content."}
|
|
| 145 |
+} |
|
| 146 |
+ |
|
| 147 |
+// ChildGCLabelsFilterLayers returns the labels for a given descriptor to |
|
| 148 |
+// reference it, skipping layer media types |
|
| 149 |
+func ChildGCLabelsFilterLayers(desc ocispec.Descriptor) []string {
|
|
| 150 |
+ if IsLayerType(desc.MediaType) {
|
|
| 151 |
+ return nil |
|
| 152 |
+ } |
|
| 153 |
+ return ChildGCLabels(desc) |
|
| 154 |
+} |
| ... | ... |
@@ -363,10 +363,34 @@ func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error {
|
| 363 | 363 |
args = append(args, "-o", o) |
| 364 | 364 |
} |
| 365 | 365 |
args = append(args, "-t", strings.TrimPrefix(m.Type, typePrefix)) |
| 366 |
- cmd := exec.Command(helperBinary, args...) |
|
| 367 |
- out, err := cmd.CombinedOutput() |
|
| 366 |
+ |
|
| 367 |
+ infoBeforeMount, err := Lookup(target) |
|
| 368 | 368 |
if err != nil {
|
| 369 |
- return errors.Wrapf(err, "mount helper [%s %v] failed: %q", helperBinary, args, string(out)) |
|
| 369 |
+ return err |
|
| 370 | 370 |
} |
| 371 |
- return nil |
|
| 371 |
+ |
|
| 372 |
+ // cmd.CombinedOutput() may intermittently return ECHILD because of our signal handling in shim. |
|
| 373 |
+ // See #4387 and wait(2). |
|
| 374 |
+ const retriesOnECHILD = 10 |
|
| 375 |
+ for i := 0; i < retriesOnECHILD; i++ {
|
|
| 376 |
+ cmd := exec.Command(helperBinary, args...) |
|
| 377 |
+ out, err := cmd.CombinedOutput() |
|
| 378 |
+ if err == nil {
|
|
| 379 |
+ return nil |
|
| 380 |
+ } |
|
| 381 |
+ if !errors.Is(err, unix.ECHILD) {
|
|
| 382 |
+ return errors.Wrapf(err, "mount helper [%s %v] failed: %q", helperBinary, args, string(out)) |
|
| 383 |
+ } |
|
| 384 |
+ // We got ECHILD, we are not sure whether the mount was successful. |
|
| 385 |
+ // If the mount ID has changed, we are sure we got some new mount, but still not sure it is fully completed. |
|
| 386 |
+ // So we attempt to unmount the new mount before retrying. |
|
| 387 |
+ infoAfterMount, err := Lookup(target) |
|
| 388 |
+ if err != nil {
|
|
| 389 |
+ return err |
|
| 390 |
+ } |
|
| 391 |
+ if infoAfterMount.ID != infoBeforeMount.ID {
|
|
| 392 |
+ _ = unmount(target, 0) |
|
| 393 |
+ } |
|
| 394 |
+ } |
|
| 395 |
+ return errors.Errorf("mount helper [%s %v] failed with ECHILD (retired %d times)", helperBinary, args, retriesOnECHILD)
|
|
| 372 | 396 |
} |
| ... | ... |
@@ -81,11 +81,11 @@ func parseInfoFile(r io.Reader) ([]Info, error) {
|
| 81 | 81 |
p.Major, _ = strconv.Atoi(mm[0]) |
| 82 | 82 |
p.Minor, _ = strconv.Atoi(mm[1]) |
| 83 | 83 |
|
| 84 |
- p.Root, err = strconv.Unquote(`"` + fields[3] + `"`) |
|
| 84 |
+ p.Root, err = strconv.Unquote(`"` + strings.Replace(fields[3], `"`, `\"`, -1) + `"`) |
|
| 85 | 85 |
if err != nil {
|
| 86 | 86 |
return nil, errors.Wrapf(err, "parsing '%s' failed: unable to unquote root field", fields[3]) |
| 87 | 87 |
} |
| 88 |
- p.Mountpoint, err = strconv.Unquote(`"` + fields[4] + `"`) |
|
| 88 |
+ p.Mountpoint, err = strconv.Unquote(`"` + strings.Replace(fields[4], `"`, `\"`, -1) + `"`) |
|
| 89 | 89 |
if err != nil {
|
| 90 | 90 |
return nil, errors.Wrapf(err, "parsing '%s' failed: unable to unquote mount point field", fields[4]) |
| 91 | 91 |
} |
| ... | ... |
@@ -118,3 +118,10 @@ func deviceFromPath(path, permissions string) (*specs.LinuxDevice, error) {
|
| 118 | 118 |
GID: &stat.Gid, |
| 119 | 119 |
}, nil |
| 120 | 120 |
} |
| 121 |
+ |
|
| 122 |
+// WithCPUCFS sets the container's Completely fair scheduling (CFS) quota and period |
|
| 123 |
+func WithCPUCFS(quota int64, period uint64) SpecOpts {
|
|
| 124 |
+ return func(ctx context.Context, _ Client, c *containers.Container, s *Spec) error {
|
|
| 125 |
+ return nil |
|
| 126 |
+ } |
|
| 127 |
+} |
| ... | ... |
@@ -52,7 +52,7 @@ func WithWindowsIgnoreFlushesDuringBoot() SpecOpts {
|
| 52 | 52 |
} |
| 53 | 53 |
} |
| 54 | 54 |
|
| 55 |
-// WithWindowNetworksAllowUnqualifiedDNSQuery sets `Windows.IgnoreFlushesDuringBoot`. |
|
| 55 |
+// WithWindowNetworksAllowUnqualifiedDNSQuery sets `Windows.Network.AllowUnqualifiedDNSQuery`. |
|
| 56 | 56 |
func WithWindowNetworksAllowUnqualifiedDNSQuery() SpecOpts {
|
| 57 | 57 |
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
|
| 58 | 58 |
if s.Windows == nil {
|
| ... | ... |
@@ -27,7 +27,6 @@ import ( |
| 27 | 27 |
"path/filepath" |
| 28 | 28 |
"strings" |
| 29 | 29 |
"sync" |
| 30 |
- "syscall" |
|
| 31 | 30 |
"time" |
| 32 | 31 |
|
| 33 | 32 |
"github.com/containerd/console" |
| ... | ... |
@@ -39,6 +38,7 @@ import ( |
| 39 | 39 |
google_protobuf "github.com/gogo/protobuf/types" |
| 40 | 40 |
specs "github.com/opencontainers/runtime-spec/specs-go" |
| 41 | 41 |
"github.com/pkg/errors" |
| 42 |
+ "golang.org/x/sys/unix" |
|
| 42 | 43 |
) |
| 43 | 44 |
|
| 44 | 45 |
// Init represents an initial process for a container |
| ... | ... |
@@ -87,7 +87,7 @@ func NewRunc(root, path, namespace, runtime, criu string, systemd bool) *runc.Ru |
| 87 | 87 |
Command: runtime, |
| 88 | 88 |
Log: filepath.Join(path, "log.json"), |
| 89 | 89 |
LogFormat: runc.JSON, |
| 90 |
- PdeathSignal: syscall.SIGKILL, |
|
| 90 |
+ PdeathSignal: unix.SIGKILL, |
|
| 91 | 91 |
Root: filepath.Join(root, namespace), |
| 92 | 92 |
Criu: criu, |
| 93 | 93 |
SystemdCgroup: systemd, |
| ... | ... |
@@ -176,7 +176,7 @@ func (p *Init) Create(ctx context.Context, r *CreateConfig) error {
|
| 176 | 176 |
} |
| 177 | 177 |
|
| 178 | 178 |
func (p *Init) openStdin(path string) error {
|
| 179 |
- sc, err := fifo.OpenFifo(context.Background(), path, syscall.O_WRONLY|syscall.O_NONBLOCK, 0) |
|
| 179 |
+ sc, err := fifo.OpenFifo(context.Background(), path, unix.O_WRONLY|unix.O_NONBLOCK, 0) |
|
| 180 | 180 |
if err != nil {
|
| 181 | 181 |
return errors.Wrapf(err, "failed to open stdin fifo %s", path) |
| 182 | 182 |
} |
| ... | ... |
@@ -361,7 +361,7 @@ func (p *Init) KillAll(ctx context.Context) error {
|
| 361 | 361 |
p.mu.Lock() |
| 362 | 362 |
defer p.mu.Unlock() |
| 363 | 363 |
|
| 364 |
- err := p.runtime.Kill(ctx, p.id, int(syscall.SIGKILL), &runc.KillOpts{
|
|
| 364 |
+ err := p.runtime.Kill(ctx, p.id, int(unix.SIGKILL), &runc.KillOpts{
|
|
| 365 | 365 |
All: true, |
| 366 | 366 |
}) |
| 367 | 367 |
return p.runtimeError(err, "OCI runtime killall failed") |
| ... | ... |
@@ -137,6 +137,8 @@ func checkKillError(err error) error {
|
| 137 | 137 |
strings.Contains(strings.ToLower(err.Error()), "no such process") || |
| 138 | 138 |
err == unix.ESRCH {
|
| 139 | 139 |
return errors.Wrapf(errdefs.ErrNotFound, "process already finished") |
| 140 |
+ } else if strings.Contains(err.Error(), "does not exist") {
|
|
| 141 |
+ return errors.Wrapf(errdefs.ErrNotFound, "no such container") |
|
| 140 | 142 |
} |
| 141 | 143 |
return errors.Wrapf(err, "unknown error after kill") |
| 142 | 144 |
} |
| ... | ... |
@@ -74,8 +74,8 @@ func getCPUInfo(pattern string) (info string, err error) {
|
| 74 | 74 |
} |
| 75 | 75 |
|
| 76 | 76 |
func getCPUVariant() string {
|
| 77 |
- if runtime.GOOS == "windows" {
|
|
| 78 |
- // Windows only supports v7 for ARM32 and v8 for ARM64 and so we can use |
|
| 77 |
+ if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
|
|
| 78 |
+ // Windows/Darwin only supports v7 for ARM32 and v8 for ARM64 and so we can use |
|
| 79 | 79 |
// runtime.GOARCH to determine the variants |
| 80 | 80 |
var variant string |
| 81 | 81 |
switch runtime.GOARCH {
|
| ... | ... |
@@ -159,7 +159,7 @@ func (c *Client) fetch(ctx context.Context, rCtx *RemoteContext, ref string, lim |
| 159 | 159 |
// Get all the children for a descriptor |
| 160 | 160 |
childrenHandler := images.ChildrenHandler(store) |
| 161 | 161 |
// Set any children labels for that content |
| 162 |
- childrenHandler = images.SetChildrenLabels(store, childrenHandler) |
|
| 162 |
+ childrenHandler = images.SetChildrenMappedLabels(store, childrenHandler, rCtx.ChildLabelMap) |
|
| 163 | 163 |
if rCtx.AllMetadata {
|
| 164 | 164 |
// Filter manifests by platforms but allow to handle manifest |
| 165 | 165 |
// and configuration for not-target platforms |
| ... | ... |
@@ -450,6 +450,9 @@ func (r *dockerBase) request(host RegistryHost, method string, ps ...string) *re |
| 450 | 450 |
for key, value := range r.header {
|
| 451 | 451 |
header[key] = append(header[key], value...) |
| 452 | 452 |
} |
| 453 |
+ for key, value := range host.Header {
|
|
| 454 |
+ header[key] = append(header[key], value...) |
|
| 455 |
+ } |
|
| 453 | 456 |
parts := append([]string{"/", host.Path, r.namespace}, ps...)
|
| 454 | 457 |
p := path.Join(parts...) |
| 455 | 458 |
// Join strips trailing slash, re-add ending "/" if included |
| ... | ... |
@@ -324,21 +324,31 @@ func (c *Client) signalShim(ctx context.Context, sig syscall.Signal) error {
|
| 324 | 324 |
select {
|
| 325 | 325 |
case <-ctx.Done(): |
| 326 | 326 |
return ctx.Err() |
| 327 |
- case <-c.waitForExit(pid): |
|
| 327 |
+ case <-c.waitForExit(ctx, pid): |
|
| 328 | 328 |
return nil |
| 329 | 329 |
} |
| 330 | 330 |
} |
| 331 | 331 |
|
| 332 |
-func (c *Client) waitForExit(pid int) <-chan struct{} {
|
|
| 333 |
- c.exitOnce.Do(func() {
|
|
| 332 |
+func (c *Client) waitForExit(ctx context.Context, pid int) <-chan struct{} {
|
|
| 333 |
+ go c.exitOnce.Do(func() {
|
|
| 334 |
+ defer close(c.exitCh) |
|
| 335 |
+ |
|
| 336 |
+ ticker := time.NewTicker(10 * time.Millisecond) |
|
| 337 |
+ defer ticker.Stop() |
|
| 338 |
+ |
|
| 334 | 339 |
for {
|
| 335 | 340 |
// use kill(pid, 0) here because the shim could have been reparented |
| 336 | 341 |
// and we are no longer able to waitpid(pid, ...) on the shim |
| 337 | 342 |
if err := unix.Kill(pid, 0); err == unix.ESRCH {
|
| 338 |
- close(c.exitCh) |
|
| 339 | 343 |
return |
| 340 | 344 |
} |
| 341 |
- time.Sleep(10 * time.Millisecond) |
|
| 345 |
+ |
|
| 346 |
+ select {
|
|
| 347 |
+ case <-ticker.C: |
|
| 348 |
+ case <-ctx.Done(): |
|
| 349 |
+ log.G(ctx).WithField("pid", pid).Warn("timed out while waiting for shim to exit")
|
|
| 350 |
+ return |
|
| 351 |
+ } |
|
| 342 | 352 |
} |
| 343 | 353 |
}) |
| 344 | 354 |
return c.exitCh |
| 345 | 355 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,35 @@ |
| 0 |
+// +build !windows |
|
| 1 |
+ |
|
| 2 |
+/* |
|
| 3 |
+ Copyright The containerd Authors. |
|
| 4 |
+ |
|
| 5 |
+ Licensed under the Apache License, Version 2.0 (the "License"); |
|
| 6 |
+ you may not use this file except in compliance with the License. |
|
| 7 |
+ You may obtain a copy of the License at |
|
| 8 |
+ |
|
| 9 |
+ http://www.apache.org/licenses/LICENSE-2.0 |
|
| 10 |
+ |
|
| 11 |
+ Unless required by applicable law or agreed to in writing, software |
|
| 12 |
+ distributed under the License is distributed on an "AS IS" BASIS, |
|
| 13 |
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
| 14 |
+ See the License for the specific language governing permissions and |
|
| 15 |
+ limitations under the License. |
|
| 16 |
+*/ |
|
| 17 |
+ |
|
| 18 |
+package containerd |
|
| 19 |
+ |
|
| 20 |
+import ( |
|
| 21 |
+ "fmt" |
|
| 22 |
+ |
|
| 23 |
+ "github.com/containerd/containerd/snapshots" |
|
| 24 |
+) |
|
| 25 |
+ |
|
| 26 |
+// WithRemapperLabels creates the labels used by any supporting snapshotter |
|
| 27 |
+// to shift the filesystem ownership (user namespace mapping) automatically; currently |
|
| 28 |
+// supported by the fuse-overlayfs snapshotter |
|
| 29 |
+func WithRemapperLabels(ctrUID, hostUID, ctrGID, hostGID, length uint32) snapshots.Opt {
|
|
| 30 |
+ return snapshots.WithLabels(map[string]string{
|
|
| 31 |
+ "containerd.io/snapshot/uidmapping": fmt.Sprintf("%d:%d:%d", ctrUID, hostUID, length),
|
|
| 32 |
+ "containerd.io/snapshot/gidmapping": fmt.Sprintf("%d:%d:%d", ctrGID, hostGID, length),
|
|
| 33 |
+ }) |
|
| 34 |
+} |
| ... | ... |
@@ -35,6 +35,7 @@ import ( |
| 35 | 35 |
"github.com/containerd/containerd/errdefs" |
| 36 | 36 |
"github.com/containerd/containerd/images" |
| 37 | 37 |
"github.com/containerd/containerd/mount" |
| 38 |
+ "github.com/containerd/containerd/oci" |
|
| 38 | 39 |
"github.com/containerd/containerd/plugin" |
| 39 | 40 |
"github.com/containerd/containerd/rootfs" |
| 40 | 41 |
"github.com/containerd/containerd/runtime/linux/runctypes" |
| ... | ... |
@@ -175,18 +176,26 @@ type Task interface {
|
| 175 | 175 |
// For the built in Linux runtime, github.com/containerd/cgroups.Metrics |
| 176 | 176 |
// are returned in protobuf format |
| 177 | 177 |
Metrics(context.Context) (*types.Metric, error) |
| 178 |
+ // Spec returns the current OCI specification for the task |
|
| 179 |
+ Spec(context.Context) (*oci.Spec, error) |
|
| 178 | 180 |
} |
| 179 | 181 |
|
| 180 | 182 |
var _ = (Task)(&task{})
|
| 181 | 183 |
|
| 182 | 184 |
type task struct {
|
| 183 | 185 |
client *Client |
| 186 |
+ c Container |
|
| 184 | 187 |
|
| 185 | 188 |
io cio.IO |
| 186 | 189 |
id string |
| 187 | 190 |
pid uint32 |
| 188 | 191 |
} |
| 189 | 192 |
|
| 193 |
+// Spec returns the current OCI specification for the task |
|
| 194 |
+func (t *task) Spec(ctx context.Context) (*oci.Spec, error) {
|
|
| 195 |
+ return t.c.Spec(ctx) |
|
| 196 |
+} |
|
| 197 |
+ |
|
| 190 | 198 |
// ID of the task |
| 191 | 199 |
func (t *task) ID() string {
|
| 192 | 200 |
return t.id |
| ... | ... |
@@ -178,13 +178,13 @@ EachLayer: |
| 178 | 178 |
fetchC[i] = make(chan struct{})
|
| 179 | 179 |
} |
| 180 | 180 |
|
| 181 |
- go func() {
|
|
| 181 |
+ go func(i int) {
|
|
| 182 | 182 |
err := u.fetch(ctx, h, layers[i:], fetchC) |
| 183 | 183 |
if err != nil {
|
| 184 | 184 |
fetchErr <- err |
| 185 | 185 |
} |
| 186 | 186 |
close(fetchErr) |
| 187 |
- }() |
|
| 187 |
+ }(i) |
|
| 188 | 188 |
} |
| 189 | 189 |
|
| 190 | 190 |
select {
|
| ... | ... |
@@ -1,102 +1,102 @@ |
| 1 |
-github.com/beorn7/perks 37c8de3658fcb183f997c4e13e8337516ab753e6 # v1.0.1 |
|
| 2 |
-github.com/BurntSushi/toml 3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005 # v0.3.1 |
|
| 3 |
-github.com/cespare/xxhash/v2 d7df74196a9e781ede915320c11c378c1b2f3a1f # v2.1.1 |
|
| 1 |
+github.com/beorn7/perks v1.0.1 |
|
| 2 |
+github.com/BurntSushi/toml v0.3.1 |
|
| 3 |
+github.com/cespare/xxhash/v2 v2.1.1 |
|
| 4 | 4 |
github.com/containerd/btrfs 153935315f4ab9be5bf03650a1341454b05efa5d |
| 5 |
-github.com/containerd/cgroups b4448137398923af7f4918b8b2ad8249172ca7a6 |
|
| 6 |
-github.com/containerd/console 8375c3424e4d7b114e8a90a4a40c8e1b40d1d4e6 # v1.0.0 |
|
| 7 |
-github.com/containerd/continuity 0ec596719c75bfd42908850990acea594b7593ac |
|
| 8 |
-github.com/containerd/fifo bda0ff6ed73c67bfb5e62bc9c697f146b7fd7f13 |
|
| 9 |
-github.com/containerd/go-runc a5c2862aed5e6358b305b0e16bfce58e0549b1cd |
|
| 10 |
-github.com/containerd/ttrpc 72bb1b21c5b0a4a107f59dd85f6ab58e564b68d6 # v1.0.1 |
|
| 11 |
-github.com/containerd/typeurl cd3ce7159eae562a4f60ceff37dada11a939d247 # v1.0.1 |
|
| 12 |
-github.com/coreos/go-systemd/v22 2d78030078ef61b3cae27f42ad6d0e46db51b339 # v22.0.0 |
|
| 13 |
-github.com/cpuguy83/go-md2man 7762f7e404f8416dfa1d9bb6a8c192aa9acb4d19 # v1.0.10 |
|
| 5 |
+github.com/containerd/cgroups 318312a373405e5e91134d8063d04d59768a1bff |
|
| 6 |
+github.com/containerd/console v1.0.0 |
|
| 7 |
+github.com/containerd/continuity efbc4488d8fe1bdc16bde3b2d2990d9b3a899165 |
|
| 8 |
+github.com/containerd/fifo f15a3290365b9d2627d189e619ab4008e0069caf |
|
| 9 |
+github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c |
|
| 10 |
+github.com/containerd/ttrpc v1.0.1 |
|
| 11 |
+github.com/containerd/typeurl v1.0.1 |
|
| 12 |
+github.com/coreos/go-systemd/v22 v22.1.0 |
|
| 13 |
+github.com/cpuguy83/go-md2man/v2 v2.0.0 |
|
| 14 | 14 |
github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f |
| 15 |
-github.com/docker/go-metrics b619b3592b65de4f087d9f16863a7e6ff905973c # v0.0.1 |
|
| 16 |
-github.com/docker/go-units 519db1ee28dcc9fd2474ae59fca29a810482bfb1 # v0.4.0 |
|
| 17 |
-github.com/godbus/dbus/v5 37bf87eef99d69c4f1d3528bd66e3a87dc201472 # v5.0.3 |
|
| 18 |
-github.com/gogo/googleapis 01e0f9cca9b92166042241267ee2a5cdf5cff46c # v1.3.2 |
|
| 19 |
-github.com/gogo/protobuf 5628607bb4c51c3157aacc3a50f0ab707582b805 # v1.3.1 |
|
| 20 |
-github.com/golang/protobuf d23c5127dc24889085f8ccea5c9d560a57a879d8 # v1.3.3 |
|
| 21 |
-github.com/google/go-cmp 3af367b6b30c263d47e8895973edcca9a49cf029 # v0.2.0 |
|
| 22 |
-github.com/google/uuid 0cd6bf5da1e1c83f8b45653022c74f71af0538a4 # v1.1.1 |
|
| 23 |
-github.com/grpc-ecosystem/go-grpc-prometheus c225b8c3b01faf2899099b768856a9e916e5087b # v1.2.0 |
|
| 24 |
-github.com/hashicorp/errwrap 8a6fb523712970c966eefc6b39ed2c5e74880354 # v1.0.0 |
|
| 25 |
-github.com/hashicorp/go-multierror 886a7fbe3eb1c874d46f623bfa70af45f425b3d1 # v1.0.0 |
|
| 26 |
-github.com/hashicorp/golang-lru 7f827b33c0f158ec5dfbba01bb0b14a4541fd81d # v0.5.3 |
|
| 27 |
-github.com/imdario/mergo 7c29201646fa3de8506f701213473dd407f19646 # v0.3.7 |
|
| 28 |
-github.com/konsorten/go-windows-terminal-sequences edb144dfd453055e1e49a3d8b410a660b5a87613 # v1.0.3 |
|
| 29 |
-github.com/matttproud/golang_protobuf_extensions c12348ce28de40eed0136aa2b644d0ee0650e56c # v1.0.1 |
|
| 30 |
-github.com/Microsoft/go-winio 6c72808b55902eae4c5943626030429ff20f3b63 # v0.4.14 |
|
| 31 |
-github.com/Microsoft/hcsshim 5bc557dd210ff2caf615e6e22d398123de77fc11 # v0.8.9 |
|
| 32 |
-github.com/opencontainers/go-digest c9281466c8b2f606084ac71339773efd177436e7 |
|
| 33 |
-github.com/opencontainers/image-spec d60099175f88c47cd379c4738d158884749ed235 # v1.0.1 |
|
| 34 |
-github.com/opencontainers/runc dc9208a3303feef5b3839f4323d9beb36df0a9dd # v1.0.0-rc10 |
|
| 35 |
-github.com/opencontainers/runtime-spec c4ee7d12c742ffe806cd9350b6af3b4b19faed6f # v1.0.2 |
|
| 36 |
-github.com/pkg/errors 614d223910a179a466c1767a985424175c39b465 # v0.9.1 |
|
| 37 |
-github.com/prometheus/client_golang c42bebe5a5cddfc6b28cd639103369d8a75dfa89 # v1.3.0 |
|
| 38 |
-github.com/prometheus/client_model d1d2010b5beead3fa1c5f271a5cf626e40b3ad6e # v0.1.0 |
|
| 39 |
-github.com/prometheus/common 287d3e634a1e550c9e463dd7e5a75a422c614505 # v0.7.0 |
|
| 40 |
-github.com/prometheus/procfs 6d489fc7f1d9cd890a250f3ea3431b1744b9623f # v0.0.8 |
|
| 41 |
-github.com/russross/blackfriday 05f3235734ad95d0016f6a23902f06461fcf567a # v1.5.2 |
|
| 42 |
-github.com/sirupsen/logrus 60c74ad9be0d874af0ab0daef6ab07c5c5911f0d # v1.6.0 |
|
| 15 |
+github.com/docker/go-metrics v0.0.1 |
|
| 16 |
+github.com/docker/go-units v0.4.0 |
|
| 17 |
+github.com/godbus/dbus/v5 v5.0.3 |
|
| 18 |
+github.com/gogo/googleapis v1.3.2 |
|
| 19 |
+github.com/gogo/protobuf v1.3.1 |
|
| 20 |
+github.com/golang/protobuf v1.3.5 |
|
| 21 |
+github.com/google/go-cmp v0.2.0 |
|
| 22 |
+github.com/google/uuid v1.1.1 |
|
| 23 |
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 |
|
| 24 |
+github.com/hashicorp/errwrap v1.0.0 |
|
| 25 |
+github.com/hashicorp/go-multierror v1.0.0 |
|
| 26 |
+github.com/hashicorp/golang-lru v0.5.3 |
|
| 27 |
+github.com/imdario/mergo v0.3.7 |
|
| 28 |
+github.com/konsorten/go-windows-terminal-sequences v1.0.3 |
|
| 29 |
+github.com/matttproud/golang_protobuf_extensions v1.0.1 |
|
| 30 |
+github.com/Microsoft/go-winio v0.4.14 |
|
| 31 |
+github.com/Microsoft/hcsshim v0.8.9 |
|
| 32 |
+github.com/opencontainers/go-digest v1.0.0 |
|
| 33 |
+github.com/opencontainers/image-spec v1.0.1 |
|
| 34 |
+github.com/opencontainers/runc 67169a9d43456ff0d5ae12b967acb8e366e2f181 # v1.0.0-rc91-48-g67169a9d |
|
| 35 |
+github.com/opencontainers/runtime-spec 237cc4f519e2e8f9b235bacccfa8ef5a84df2875 # v1.0.3-0.20200520003142-237cc4f519e2 |
|
| 36 |
+github.com/pkg/errors v0.9.1 |
|
| 37 |
+github.com/prometheus/client_golang v1.6.0 |
|
| 38 |
+github.com/prometheus/client_model v0.2.0 |
|
| 39 |
+github.com/prometheus/common v0.9.1 |
|
| 40 |
+github.com/prometheus/procfs v0.0.11 |
|
| 41 |
+github.com/russross/blackfriday/v2 v2.0.1 |
|
| 42 |
+github.com/shurcooL/sanitized_anchor_name v1.0.0 |
|
| 43 |
+github.com/sirupsen/logrus v1.6.0 |
|
| 43 | 44 |
github.com/syndtr/gocapability d98352740cb2c55f81556b63d4a1ec64c5a319c2 |
| 44 |
-github.com/urfave/cli bfe2e925cfb6d44b40ad3a779165ea7e8aff9212 # v1.22.0 |
|
| 45 |
-go.etcd.io/bbolt a0458a2b35708eef59eb5f620ceb3cd1c01a824d # v1.3.3 |
|
| 46 |
-go.opencensus.io 9c377598961b706d1542bd2d84d538b5094d596e # v0.22.0 |
|
| 45 |
+github.com/urfave/cli v1.22.1 # NOTE: urfave/cli must be <= v1.22.1 due to a regression: https://github.com/urfave/cli/issues/1092 |
|
| 46 |
+go.etcd.io/bbolt v1.3.5 |
|
| 47 |
+go.opencensus.io v0.22.0 |
|
| 47 | 48 |
golang.org/x/net f3200d17e092c607f615320ecaad13d87ad9a2b3 |
| 48 | 49 |
golang.org/x/sync 42b317875d0fa942474b76e1b46a6060d720ae6e |
| 49 |
-golang.org/x/sys 5c8b2ff67527cb88b770f693cebf3799036d8bc0 |
|
| 50 |
-golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4 |
|
| 50 |
+golang.org/x/sys 9dae0f8f577553e0f21298e18926efc9644c281d |
|
| 51 |
+golang.org/x/text v0.3.3 |
|
| 51 | 52 |
google.golang.org/genproto e50cd9704f63023d62cd06a1994b98227fc4d21a |
| 52 |
-google.golang.org/grpc f495f5b15ae7ccda3b38c53a1bfcde4c1a58a2bc # v1.27.1 |
|
| 53 |
-gotest.tools/v3 bb0d8a963040ea5048dcef1a14d8f8b58a33d4b3 # v3.0.2 |
|
| 53 |
+google.golang.org/grpc v1.27.1 |
|
| 54 |
+gotest.tools/v3 v3.0.2 |
|
| 54 | 55 |
|
| 55 | 56 |
# cgroups dependencies |
| 56 |
-github.com/cilium/ebpf 4032b1d8aae306b7bb94a2a11002932caf88c644 |
|
| 57 |
+github.com/cilium/ebpf 1c8d4c9ef7759622653a1d319284a44652333b28 |
|
| 57 | 58 |
|
| 58 | 59 |
# cri dependencies |
| 59 |
-github.com/containerd/cri 65830369b6b2b4edc454bf5cebbd9b76c1c1ac66 # master |
|
| 60 |
-github.com/davecgh/go-spew 8991bc29aa16c548c550c7ff78260e27b9ab7c73 # v1.1.1 |
|
| 61 |
-github.com/docker/distribution 0d3efadf0154c2b8a4e7b6621fff9809655cc580 |
|
| 60 |
+github.com/containerd/cri 8448b92d237e877bed1e4aa7a0baf0dee234dbcb # master |
|
| 61 |
+github.com/davecgh/go-spew v1.1.1 |
|
| 62 | 62 |
github.com/docker/docker 4634ce647cf2ce2c6031129ccd109e557244986f |
| 63 | 63 |
github.com/docker/spdystream 449fdfce4d962303d702fec724ef0ad181c92528 |
| 64 |
-github.com/emicklei/go-restful b993709ae1a4f6dd19cfa475232614441b11c9d5 # v2.9.5 |
|
| 65 |
-github.com/google/gofuzz db92cf7ae75e4a7a28abc005addab2b394362888 # v1.1.0 |
|
| 66 |
-github.com/json-iterator/go 03217c3e97663914aec3faafde50d081f197a0a2 # v1.1.8 |
|
| 67 |
-github.com/modern-go/concurrent bacd9c7ef1dd9b15be4a9909b8ac7a4e313eec94 # 1.0.3 |
|
| 68 |
-github.com/modern-go/reflect2 4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd # 1.0.1 |
|
| 69 |
-github.com/opencontainers/selinux 0d49ba2a6aae052c614dfe5de62a158711a6c461 # 1.5.1 |
|
| 70 |
-github.com/seccomp/libseccomp-golang 689e3c1541a84461afc49c1c87352a6cedf72e9c # v0.9.1 |
|
| 71 |
-github.com/stretchr/testify 221dbe5ed46703ee255b1da0dec05086f5035f62 # v1.4.0 |
|
| 72 |
-github.com/tchap/go-patricia 666120de432aea38ab06bd5c818f04f4129882c9 # v2.2.6 |
|
| 64 |
+github.com/emicklei/go-restful v2.9.5 |
|
| 65 |
+github.com/go-logr/logr v0.2.0 |
|
| 66 |
+github.com/google/gofuzz v1.1.0 |
|
| 67 |
+github.com/json-iterator/go v1.1.9 |
|
| 68 |
+github.com/modern-go/concurrent 1.0.3 |
|
| 69 |
+github.com/modern-go/reflect2 v1.0.1 |
|
| 70 |
+github.com/opencontainers/selinux v1.6.0 |
|
| 71 |
+github.com/seccomp/libseccomp-golang v0.9.1 |
|
| 72 |
+github.com/tchap/go-patricia v2.2.6 |
|
| 73 |
+github.com/willf/bitset d5bec3311243426a3c6d1b7a795f24b17c686dbb # 1.1.10+ used by selinux pkg |
|
| 73 | 74 |
golang.org/x/crypto bac4c82f69751a6dd76e702d54b3ceb88adab236 |
| 74 |
-golang.org/x/oauth2 0f29369cfe4552d0e4bcddc57cc75f4d7e672a33 |
|
| 75 |
-golang.org/x/time 9d24e82272b4f38b78bc8cff74fa936d31ccd8ef |
|
| 76 |
-gopkg.in/inf.v0 d2d2541c53f18d2a059457998ce2876cc8e67cbf # v0.9.1 |
|
| 77 |
-gopkg.in/yaml.v2 53403b58ad1b561927d19068c655246f2db79d48 # v2.2.8 |
|
| 78 |
-k8s.io/api d2dce8e1788e4be2be3a62b6439b3eaa087df0df # v0.18.0 |
|
| 79 |
-k8s.io/apimachinery 105e0c6d63f10531ed07f3b5a2195771a0fa444b # v0.18.0 |
|
| 80 |
-k8s.io/apiserver 5c8e895629a454efd75a453d1dea5b8142db0013 # v0.18.0 |
|
| 81 |
-k8s.io/client-go 0b19784585bd0a0ee5509855829ead81feaa2bdc # v0.18.0 |
|
| 82 |
-k8s.io/cri-api 3d1680d8d202aa12c5dc5689170c3c03a488d35b # v0.18.0 |
|
| 83 |
-k8s.io/klog 2ca9ad30301bf30a8a6e0fa2110db6b8df699a91 # v1.0.0 |
|
| 84 |
-k8s.io/kubernetes 9e991415386e4cf155a24b1da15becaa390438d8 # v1.18.0 |
|
| 85 |
-k8s.io/utils a9aa75ae1b89e1b992c33383f48e942d97e52dae |
|
| 86 |
-sigs.k8s.io/structured-merge-diff/v3 877aee05330847a873a1a8998b40e12a1e0fde25 # v3.0.0 |
|
| 87 |
-sigs.k8s.io/yaml 9fc95527decd95bb9d28cc2eab08179b2d0f6971 # v1.2.0 |
|
| 75 |
+golang.org/x/oauth2 858c2ad4c8b6c5d10852cb89079f6ca1c7309787 |
|
| 76 |
+golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82 |
|
| 77 |
+gopkg.in/inf.v0 v0.9.1 |
|
| 78 |
+gopkg.in/yaml.v2 v2.2.8 |
|
| 79 |
+k8s.io/api v0.19.0-beta.2 |
|
| 80 |
+k8s.io/apimachinery v0.19.0-beta.2 |
|
| 81 |
+k8s.io/apiserver v0.19.0-beta.2 |
|
| 82 |
+k8s.io/client-go v0.19.0-beta.2 |
|
| 83 |
+k8s.io/cri-api v0.19.0-beta.2 |
|
| 84 |
+k8s.io/klog/v2 v2.2.0 |
|
| 85 |
+k8s.io/utils 2df71ebbae66f39338aed4cd0bb82d2212ee33cc |
|
| 86 |
+sigs.k8s.io/structured-merge-diff/v3 v3.0.0 |
|
| 87 |
+sigs.k8s.io/yaml v1.2.0 |
|
| 88 | 88 |
|
| 89 | 89 |
# cni dependencies |
| 90 |
-github.com/containerd/go-cni 0d360c50b10b350b6bb23863fd4dfb1c232b01c9 |
|
| 91 |
-github.com/containernetworking/cni 4cfb7b568922a3c79a23e438dc52fe537fc9687e # v0.7.1 |
|
| 92 |
-github.com/containernetworking/plugins 9f96827c7cabb03f21d86326000c00f61e181f6a # v0.7.6 |
|
| 93 |
-github.com/fsnotify/fsnotify 4bf2d1fec78374803a39307bfb8d340688f4f28e # v1.4.8 |
|
| 90 |
+github.com/containerd/go-cni v1.0.0 |
|
| 91 |
+github.com/containernetworking/cni v0.7.1 |
|
| 92 |
+github.com/containernetworking/plugins v0.7.6 |
|
| 93 |
+github.com/fsnotify/fsnotify v1.4.9 |
|
| 94 | 94 |
|
| 95 | 95 |
# image decrypt depedencies |
| 96 |
-github.com/containerd/imgcrypt 9e761ccd6069fb707ec9493435f31475b5524b38 # v1.0.1 |
|
| 97 |
-github.com/containers/ocicrypt 0343cc6053fd65069df55bce6838096e09b4033a # v1.0.1 from containerd/imgcrypt |
|
| 98 |
-github.com/fullsailor/pkcs7 8306686428a5fe132eac8cb7c4848af725098bd4 # from containers/ocicrypt |
|
| 99 |
-gopkg.in/square/go-jose.v2 730df5f748271903322feb182be83b43ebbbe27d # v2.3.1 from containers/ocicrypt |
|
| 96 |
+github.com/containerd/imgcrypt v1.0.1 |
|
| 97 |
+github.com/containers/ocicrypt v1.0.1 |
|
| 98 |
+github.com/fullsailor/pkcs7 8306686428a5fe132eac8cb7c4848af725098bd4 |
|
| 99 |
+gopkg.in/square/go-jose.v2 v2.3.1 |
|
| 100 | 100 |
|
| 101 | 101 |
# zfs dependencies |
| 102 | 102 |
github.com/containerd/zfs 9abf673ca6ff9ab8d9bd776a4ceff8f6dc699c3d |
| ... | ... |
@@ -23,7 +23,7 @@ var ( |
| 23 | 23 |
Package = "github.com/containerd/containerd" |
| 24 | 24 |
|
| 25 | 25 |
// Version holds the complete version number. Filled in at linking time. |
| 26 |
- Version = "1.3.0+unknown" |
|
| 26 |
+ Version = "1.4.0-beta.2+unknown" |
|
| 27 | 27 |
|
| 28 | 28 |
// Revision is filled with the VCS (e.g. git) revision being used to build |
| 29 | 29 |
// the program at linking time. |
| ... | ... |
@@ -27,6 +27,7 @@ import ( |
| 27 | 27 |
"github.com/pkg/errors" |
| 28 | 28 |
) |
| 29 | 29 |
|
| 30 |
+//nolint:golint |
|
| 30 | 31 |
const O_PATH = 010000000 |
| 31 | 32 |
|
| 32 | 33 |
type handle struct {
|
| ... | ... |
@@ -56,9 +57,10 @@ func getHandle(fn string) (*handle, error) {
|
| 56 | 56 |
h := &handle{
|
| 57 | 57 |
f: f, |
| 58 | 58 |
name: fn, |
| 59 |
- dev: uint64(stat.Dev), |
|
| 60 |
- ino: stat.Ino, |
|
| 61 |
- fd: fd, |
|
| 59 |
+ //nolint:unconvert |
|
| 60 |
+ dev: uint64(stat.Dev), |
|
| 61 |
+ ino: stat.Ino, |
|
| 62 |
+ fd: fd, |
|
| 62 | 63 |
} |
| 63 | 64 |
|
| 64 | 65 |
// check /proc just in case |
| ... | ... |
@@ -83,6 +85,7 @@ func (h *handle) Path() (string, error) {
|
| 83 | 83 |
if err := syscall.Stat(h.procPath(), &stat); err != nil {
|
| 84 | 84 |
return "", errors.Wrapf(err, "path %v could not be statted", h.procPath()) |
| 85 | 85 |
} |
| 86 |
+ //nolint:unconvert |
|
| 86 | 87 |
if uint64(stat.Dev) != h.dev || stat.Ino != h.ino {
|
| 87 | 88 |
return "", errors.Errorf("failed to verify handle %v/%v %v/%v", stat.Dev, h.dev, stat.Ino, h.ino)
|
| 88 | 89 |
} |
| ... | ... |
@@ -23,7 +23,7 @@ import ( |
| 23 | 23 |
) |
| 24 | 24 |
|
| 25 | 25 |
// SyscallConn provides raw access to the fifo's underlying filedescrptor. |
| 26 |
-// See syscall.Conn for guarentees provided by this interface. |
|
| 26 |
+// See syscall.Conn for guarantees provided by this interface. |
|
| 27 | 27 |
func (f *fifo) SyscallConn() (syscall.RawConn, error) {
|
| 28 | 28 |
// deterministic check for closed |
| 29 | 29 |
select {
|