containerd/pkg/process
Rodrigo Campos 2e13d39546 pkg/process: Only use idmap mounts if runc supports it
runc, as mandated by the runtime-spec, ignores unknown fields in the
config.json. This is unfortunate for cases where we _must_ enable that
feature or fail.

For example, if we want to start a container with user namespaces and
volumes, using the uidMappings/gidMappings field is needed so the
UID/GIDs in the volume don't end up with garbage. However, if we don't
fail when runc will ignore these fields (because they are unknown to
runc), we will just start a container without using the mappings and the
UID/GIDs the container will persist to volumes the hostUID/GID, that can
change if the container is re-scheduled by Kubernetes.

This will end up in volumes having "garbage" and unmapped UIDs that the
container can no longer change. So, let's avoid this entirely by just
checking that runc supports idmap mounts if the container we are about
to create needs them.

Please note that the "runc features" subcommand is only run when we are
using idmap mounts. If idmap mounts are not used, the subcommand is not
run and therefore this should not affect containers that don't use idmap
mounts in any way.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-09-13 16:44:54 +02:00
..
deleted_state.go chore: use go fix to cleanup old +build buildtag 2022-12-29 14:25:14 +08:00
exec_state.go chore: use go fix to cleanup old +build buildtag 2022-12-29 14:25:14 +08:00
exec.go chore: use go fix to cleanup old +build buildtag 2022-12-29 14:25:14 +08:00
init_state.go Remove most logrus 2023-08-26 14:31:53 -04:00
init.go pkg/process: Only use idmap mounts if runc supports it 2023-09-13 16:44:54 +02:00
io_test.go chore: use go fix to cleanup old +build buildtag 2022-12-29 14:25:14 +08:00
io_util.go replace uses of os/exec with golang.org/x/sys/execabs 2021-08-25 18:11:09 +02:00
io.go Remove hashicorp/go-multierror 2023-08-20 17:59:45 -07:00
process.go Refactor runtime code for code sharing 2019-07-08 11:47:53 -04:00
types.go Consolidate gogo/protobuf dependencies under our own protobuf package 2022-04-19 15:53:36 +00:00
utils.go pkg/process: Only use idmap mounts if runc supports it 2023-09-13 16:44:54 +02:00