Commit Graph

7 Commits

Author SHA1 Message Date
Fabricio Voznika 9262ea47a5 Add support for containerd 1.5
"cri.runtimeoptions.v1" moved to "runtimeoptions.v1" and containerd
configuration format version 2 is required.

Updates #6449

PiperOrigin-RevId: 405474653
2021-10-25 13:17:25 -07:00
Fabricio Voznika 5f2b3728fc Redirect all calls from `errdefs.ToGRPC` to `utils.ErrToGRPC`
This is to ensure that Go 1.13 error wrapping is correctly
translated to gRPC errors before returning from the shim.

Updates #6225

PiperOrigin-RevId: 382120441
2021-06-29 10:56:17 -07:00
gVisor bot fdf7c49030 Merge pull request #6228 from puppetlabs:fix-shim-pid-leaking-on-stopped-processes
PiperOrigin-RevId: 381341920
2021-06-24 14:50:49 -07:00
Noah Fontes 99f9230e3f
Ensure shim propagates errors over gRPC correctly
This change wraps containerd's errdefs.ToGRPC function with one that
understands Go 1.13-style error wrapping style, which is used
pervasively throughout the shim. With this change, errors that have been
marked with, e.g., `errdefs.ErrNotFound`, will be correctly propagated
back to the containerd server.
2021-06-23 10:54:38 -07:00
Fabricio Voznika 1e472a8572 Improve stopped container handling
Getting state of a stopped container would fail and could lead containerd
to not detecting that the container had actually stopped. Now stopped and
deleted containers return `stopped` state.

Also makes other messages more consistent when container is stopped. Some
where still sending messages to runsc and failing in different ways. Now
they go through `initState` state machine like the other messages.

There are a few changes to improve debugability with it as well.

Fixes #5861

PiperOrigin-RevId: 380698513
2021-06-21 17:19:05 -07:00
Fabricio Voznika d96499d17d Make sandbox join the pod cgroup in K8s
cgroups in K8s are setup with the following hierarchy: `.../pod/container`.
The sandbox is created with the first container and consequently uses the
the pause container cgroup. This change removes the container cgroup from
the path to make the sandbox use the pod cgroup instead. Otherwise limits
set to the pause container will apply to the entire sandbox.

PiperOrigin-RevId: 374273277
2021-05-17 13:54:46 -07:00
Fabricio Voznika 8b0f0b4d11 Delete shim v1
gvisor-containerd-shim is not compatible with containerd 1.1 or earlier.
Starting from containerd 1.2, shim v2 is the preferred interface.

PiperOrigin-RevId: 351485556
2021-01-12 17:54:10 -08:00