k3s/test/images
Kubernetes Submit Queue 84408378f9
Merge pull request #58174 from filbranden/ipcs1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixes for HostIPC tests to work when Docker has SELinux support enabled.

**What this PR does / why we need it**:

Fixes for HostIPC tests to work when Docker has SELinux support enabled.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

N/A

**Special notes for your reviewer**:

The core of the matter is to use `ipcs` from util-linux rather than the one from busybox. The typical SELinux policy has enough to allow Docker containers (running under svirt_lxc_net_t SELinux type) to access IPC information by reading the contents of the files under /proc/sysvipc/, but not by using the shmctl etc. syscalls.

The `ipcs` implementation in busybox will use `shmctl(0, SHM_INFO, ...)` to detect whether it can read IPC info (see source code [here](https://git.busybox.net/busybox/tree/util-linux/ipcs.c?h=1_28_0#n138)), while the one in util-linux will prefer to read from the /proc files directly if they are available (see source code [here](https://github.com/karelzak/util-linux/blob/v2.27.1/sys-utils/ipcutils.c#L108)).

It turns out the SELinux policy doesn't allow the shmctl syscalls in an unprivileged container, while access to it through the /proc interface is fine. (One could argue this is a bug in the SELinux policy, but getting it fixed on stable OSs is hard, and it's not that hard for us to test it with an util-linux `ipcs`, so I propose we do so.)

This PR also contains a refactor of the code setting IpcMode, since setting it in the "common options" function is misleading, as on containers other than the sandbox, it ends up always getting overwritten, so let's only set it to "host" in the Sandbox.

It also has a minor fix for the `ipcmk` call, since support for size suffix was only introduced in recent versions of it.

**Release note**:

```release-note
NONE
```
2018-01-30 17:18:52 -08:00
..
clusterapi-tester Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
cuda-vector-add
dnsutils
entrypoint-tester Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
fakegitserver Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
goproxy Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
hostexec
ipc-utils Add new e2e-test container to export ipcs from util-linux 2018-01-25 11:09:16 -08:00
iperf Revert k8s.gcr.io vanity domain 2017-12-22 14:36:16 -08:00
jessie-dnsutils
kitten Move e2e dependent images from kubernetes/kubernetes.github.io repo 2017-07-20 09:48:18 +05:30
liveness Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
logs-generator Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
mounttest Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
mounttest-user
n-way-http Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
nautilus Move e2e dependent images from kubernetes/kubernetes.github.io repo 2017-07-20 09:48:18 +05:30
net Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
netexec Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
nettest Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
no-snat-test Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
no-snat-test-proxy Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
nonewprivs Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
pets Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
port-forward-tester Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
porter Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
redis
resource-consumer Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
serve-hostname Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
test-webserver Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
volumes-tester Revert k8s.gcr.io vanity domain 2017-12-22 14:36:16 -08:00
webhook fix webhook admission README 2018-01-28 14:25:41 +08:00
BUILD update bazel 2017-10-27 15:58:24 -07:00
Makefile Update to go1.9.3 2018-01-29 18:26:59 -08:00
OWNERS Add owners file for test images 2017-12-26 20:44:45 +05:30
image-util.sh gcloud docker now auths k8s.gcr.io by default 2017-12-18 09:18:34 -08:00