cri-o/server
Sebastien Boeuf 1391c5c2fd crio: Ensure container state is stopped when calling StopContainer()
CRI-O works well with runc when stopping a container because as soon
as the container process returns, it can consider every container
resources such as its rootfs as being freed, and it can proceed
further by unmounting it.

But in case of virtualized runtime such as Clear Containers or Kata
Containers, the same rootfs is being mounted into the VM, usually as
a device being hotplugged. This means the runtime will need to be
triggered after the container process has returned. Particularly,
such runtimes should expect a call into "state" in order to realize
the container process is not running anymore, and it would trigger
the container to be officially stopped, proceeding to the necessary
unmounts.

The way this can be done from CRI-O, without impacting the case of
runc, is to explicitly wait for the container status to be updated
into "stopped" after the container process has returned. This way
CRI-O will call into "state" as long as it cannot see the container
status being updated properly, generating an error after a timeout.

Both PollUpdateStatusStopped() and WaitContainerStateStopped() make
use of go routines in order to support a timeout definition. They
follow the waitContainerStop() approach with chControl.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
2018-03-02 14:55:29 -08:00
..
apparmor container_create: fix apparmor from container config 2017-11-30 16:12:16 +01:00
fixtures Adding unit tests for server/secrets.go 2017-11-29 17:42:19 +08:00
metrics server: add prometheus metrics for CRI operations 2017-11-09 16:51:00 +01:00
seccomp container_create: fix seccomp annotations 2017-09-25 21:08:11 +02:00
config.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00
config_test.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00
container_attach.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_create.go Enable per pod PID namespace setting 2018-03-02 12:04:02 -05:00
container_exec.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_execsync.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_list.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_portforward.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_remove.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_reopen_log.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_start.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_stats.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_stats_list.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_status.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_stop.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_update_resources.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
container_updateruntimeconfig.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
image_fs_info.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
image_list.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
image_pull.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
image_remove.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
image_status.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
inspect.go Return image references from the storage package 2017-12-14 14:23:52 -05:00
inspect_test.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
naming.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
runtime_status.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
sandbox_list.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
sandbox_network.go libkpod -> lib rename 2017-11-30 17:08:26 +01:00
sandbox_remove.go crio: Ensure container state is stopped when calling StopContainer() 2018-03-02 14:55:29 -08:00
sandbox_run.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
sandbox_status.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
sandbox_stop.go crio: Ensure container state is stopped when calling StopContainer() 2018-03-02 14:55:29 -08:00
secrets.go Fixed logic flaw in the secrets mounts 2017-10-17 13:08:42 -04:00
secrets_test.go Adding unit tests for server/secrets.go 2017-11-29 17:42:19 +08:00
server.go server: prevent double channel close 2018-03-02 13:43:09 +01:00
utils.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
utils_test.go Update code for latest k8s 2018-02-21 11:03:56 -08:00
version.go Update code for latest k8s 2018-02-21 11:03:56 -08:00