cri-o/oci
Antonio Murdaca b4251aebd8
execsync: rewrite to fix a bug in conmon
conmon has many flags that are parsed when it's executed, one of them
is "-c". During PR #510 where we vendor latest kube master code,
upstream has changed a test to call a "ctr execsync" with a command of
"sh -c commmand ...".
Turns out:

a) conmon has a "-c" flag which refers to the container name/id
b) the exec command has a "-c" flags but it's for "sh"

That leads to conmon parsing the second "-c" flags from the exec
command causing an error. The executed command looks like:

conmon -c [..other flags..] CONTAINERID -e sh -c echo hello world

This patch rewrites the exec sync code to not pass down to conmon the
exec command via command line. Rather, we're now creating an OCI runtime
process spec in a temp file, pass _the path_ down to conmon, and have
runc exec the command using "runc exec --process
/path/to/process-spec.json CONTAINERID". This is far better in which we
don't need to bother anymore about conflicts with flags in conmon.

Added and fixed some tests also.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2017-05-25 22:36:33 +02:00
..
container.go Set Container Status Reason when OOM Killed 2017-05-25 11:30:58 -07:00
history.go use an in memory store for containers 2016-09-19 13:11:36 +02:00
memory_store.go oci: more grep'able interface name 2017-04-19 16:12:59 -04:00
oci.go execsync: rewrite to fix a bug in conmon 2017-05-25 22:36:33 +02:00
store.go oci: more grep'able interface name 2017-04-19 16:12:59 -04:00