Commit graph

2302 commits

Author SHA1 Message Date
OpenShift Merge Robot 22d53e2b54
Merge pull request #1798 from giuseppe/fix-notify-socket
systemd: fix NOTIFY_SOCKET with patched runc
2018-11-28 09:16:27 -08:00
OpenShift Merge Robot 88c23b0632
Merge pull request #1885 from edsantiago/split_token_none
_split_token(): handle None
2018-11-28 08:57:21 -08:00
OpenShift Merge Robot 8c15a1e067
Merge pull request #1881 from jwhonce/bug/1867
Fixes #1867
2018-11-28 08:57:10 -08:00
OpenShift Merge Robot f3289fed2e
Merge pull request #1880 from baude/f29fixes
Fix golang formatting issues
2018-11-28 08:18:24 -08:00
OpenShift Merge Robot ade0b30844
Merge pull request #1846 from cgwalters/netns-dns-localhost
Use host's resolv.conf if no network namespace enabled
2018-11-28 07:58:55 -08:00
Jhon Honce f8c5e75a10 Fixes #1867
* Some items included in the CLI and currently not supported by the API.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-28 08:56:24 -07:00
OpenShift Merge Robot 7ae37dcafc
Merge pull request #1879 from mheon/stop_stopped_is_valid
Stopping a stopped container is not an error for Podman
2018-11-28 07:39:37 -08:00
Giuseppe Scrivano 180d0c6f62
tests: fix NOTIFY_SOCKET test
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 16:33:51 +01:00
baude 61d4db4806 Fix golang formatting issues
Whe running unittests on newer golang versions, we observe failures with some
formatting types when no declared correctly.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-28 09:26:24 -06:00
Giuseppe Scrivano fe919e4914
oci: propagate NOTIFY_SOCKET on runtime start
with https://github.com/opencontainers/runc/pull/1807 we moved the
systemd notify initialization from "create" to "start", so that the
OCI runtime doesn't hang while waiting on reading from the notify
socket.  This means we also need to set the correct NOTIFY_SOCKET when
start'ing the container.

Closes: https://github.com/containers/libpod/issues/746

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 16:25:12 +01:00
Giuseppe Scrivano f7d972a70f
test: fix test for NOTIFY_SOCKET
do not make any assumption on the path inside of the container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 16:25:12 +01:00
OpenShift Merge Robot effd63d6d5
Merge pull request #1848 from adrianreber/master
Add tcp-established to checkpoint/restore
2018-11-28 07:00:24 -08:00
Matthew Heon 841f47d728 Add test to ensure stopping a stopped container works
We regressed on this at some point. Adding a new test should help
ensure that doesn't happen again.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-11-28 09:35:30 -05:00
Matthew Heon fc774ac0e5 Stopping a stopped container is not an error for Podman
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-11-28 09:35:30 -05:00
OpenShift Merge Robot d346996e15
Merge pull request #1849 from giuseppe/report-rootless-netmode
rootless: add new netmode "slirp4netns"
2018-11-28 06:18:28 -08:00
OpenShift Merge Robot 2a496aea30
Merge pull request #1833 from giuseppe/remove-exec-polling
exec: remove polling for PID file
2018-11-28 05:10:49 -08:00
OpenShift Merge Robot a7df0bc1fa
Merge pull request #1839 from giuseppe/storage-save-only-subset
rootless: store only subset of storage.conf
2018-11-28 04:43:41 -08:00
OpenShift Merge Robot 6688e9bc14
Merge pull request #1837 from giuseppe/vndr-selinux
vendor: update selinux
2018-11-28 04:43:36 -08:00
OpenShift Merge Robot dd315cc043
Merge pull request #1861 from giuseppe/fix-rootless-cleanup
rootless: fix cleanup
2018-11-28 04:27:37 -08:00
Giuseppe Scrivano fc3047322a
util: use fsnotify to wait for file
prefer a fsnotify watcher to polling the file, we take advantage of
inotify on Linux and react more promptly to the PID file being
created.

If the watcher cannot be created, then fallback to the old polling
mechanism.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 10:53:41 +01:00
Giuseppe Scrivano c4a592b632
vendor: update selinux
inherit a change for not failing a recursive relabelling if the file
is removed between the directory is read and the lsetxattr syscall.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 10:51:37 +01:00
Giuseppe Scrivano 078cb630d3
rootless: store only subset of storage.conf
do not store the entire file but only the subset of what we have
modified.  Also, we were not writing the correct data.  Since it is
not trivial to serialize storage.conf correctly and all the various
supported options, serialize only what we care about.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 10:48:30 +01:00
Giuseppe Scrivano 0365f57371
rootless: fix cleanup
The conmon exit command is running inside of a namespace where the
process is running with uid=0.  When it launches again podman for the
cleanup, podman is not running in rootless mode as the uid=0.

Export some more env variables to tell podman we are in rootless
mode.

Closes: https://github.com/containers/libpod/issues/1859

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 10:19:13 +01:00
Giuseppe Scrivano 95f22a2ca0
network: allow slirp4netns mode also for root containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 09:21:59 +01:00
Adrian Reber d3cde7cefe
Added more checkpoint/restore test cases
This adds checkpoint/restore test cases for the newly added options
 * --leave-running
 * --tcp-established
 * --all
 * --latest

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
Adrian Reber fbe8e23ce6
Fix podman container restore -a
podman container restore -a was using the wrong filter to restore
checkpointed containers. This switches from 'running' containers to
'exited' containers.

Restoring with -a only works if all exited containers have been
checkpointed. Maybe it would make sense to track which containers have
been really checkpointed. This is just to fix '-a' to work at least
if all exited containers have been checkpointed.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
Adrian Reber 4ed10c5c7a
Update bash completion for checkpoint/restore
This brings all the recent changes to checkpoint/restore to the bash
completion.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
Adrian Reber af7d67771b
Add '--tcp-established' to checkpoint/restore man page
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
Adrian Reber 03c88a3deb
Added tcp-established to checkpoint/restore
CRIU can checkpoint and restore processes/containers with established
TCP connections if the correct option is specified. To implement
checkpoint and restore with support for established TCP connections with
Podman this commit adds the necessary options to runc during checkpoint
and also tells conmon during restore to use 'runc restore' with
'--tcp-established'.

For this Podman feature to work a corresponding conmon change is
required.

Example:

$ podman run --tmpfs /tmp --name podman-criu-test -d docker://docker.io/yovfiatbeb/podman-criu-test
$ nc `podman inspect -l | jq -r '.[0].NetworkSettings.IPAddress'` 8080
GET /examples/servlets/servlet/HelloWorldExample
Connection: keep-alive

1
GET /examples/servlets/servlet/HelloWorldExample
Connection: keep-alive

2
$ # Using HTTP keep-alive multiple requests are send to the server in the container
$ # Different terminal:
$ podman container checkpoint -l
criu failed: type NOTIFY errno 0
$ # Looking at the log file would show errors because of established TCP connections
$ podman container checkpoint -l --tcp-established
$ # This works now and after the restore the same connection as above can be used for requests
$ podman container restore -l --tcp-established

The restore would fail without '--tcp-established' as the checkpoint image
contains established TCP connections.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
Adrian Reber a2bcb6d8bf
Remove unused CRIU_COMMIT variable
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
Adrian Reber a40f5c0aba
Point CRIU_COMMIT to CRIU release 3.11
The old commit points to the development branch and is not stable.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:38 +01:00
Adrian Reber 453c8bac57
Updated CRIO_COMMIT to pull in new conmon for CRIU
Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:37 +01:00
Adrian Reber 0592558289
Use also a struct to pass options to Restore()
This is basically the same change as

 ff47a4c2d5 (Use a struct to pass options to Checkpoint())

just for the Restore() function. It is used to pass multiple restore
options to the API and down to conmon which is used to restore
containers. This is for the upcoming changes to support checkpointing
and restoring containers with '--tcp-established'.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-28 08:00:37 +01:00
Ed Santiago 8b2affbd5b _split_token(): handle None
The conditional + list comprehension in images.py:_split_token()
wasn't quite working as intended; in particular, when fed None,
it chokes with

    TypeError: 'NoneType' object is not iterable

This is the correct behavior: comprehensions iterate first,
then apply the conditional.

Solution: special-case None, and remove the now-unnecessary
conditional.

Context: seen when trying 'pypodman run' against
docker.io/stackbrew/centos:7, which has no .ContainerConfig.Eng

Signed-off-by: Ed Santiago <santiago@redhat.com>
2018-11-27 16:13:36 -07:00
Colin Walters 870eed9378 Use host's resolv.conf if no network namespace enabled
My host system runs Fedora Silverblue 29 and I have NetworkManager's
`dns=dnsmasq` setting enabled, so my `/etc/resolv.conf` only has
`127.0.0.1`.

I also run my development podman containers with `--net=host`
for various reasons.

If we have a host network namespace, there's no reason not to just
use the host's nameserver configuration either.

This fixes e.g. accessing content on a VPN, and is also faster
since the container is using cached DNS.

I know this doesn't solve the bigger picture issue of localhost-DNS
conflicting with bridged networking, but that's far more involved,
probably requiring a DNS proxy in the container.  This patch
makes my workflow a lot nicer and was easy to write.

Signed-off-by: Colin Walters <walters@verbum.org>
2018-11-27 15:28:09 -05:00
Giuseppe Scrivano 4203df69ac
rootless: add new netmode "slirp4netns"
so that inspect reports the correct network configuration.

Closes: https://github.com/containers/libpod/issues/1453

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-27 21:10:16 +01:00
Giuseppe Scrivano 266c4952a8
tests: change return type for PodmanAsUser to PodmanTestIntegration
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-27 21:10:15 +01:00
OpenShift Merge Robot 6df7409cb5
Merge pull request #1878 from giuseppe/fix-static-ip-test
test: cleanup CNI network used by the tests
2018-11-27 11:56:03 -08:00
Giuseppe Scrivano 55508c1185
test: cleanup CNI network used by the tests
issue introduced with:

https://github.com/containers/libpod/pull/1871

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-27 16:55:28 +01:00
OpenShift Merge Robot 3f0c0cf80f
Merge pull request #1874 from ypu/mount-test
Improve podman run --mount test
2018-11-27 04:30:02 -08:00
OpenShift Merge Robot c1489e6317
Merge pull request #1863 from afbjorklund/podman_version
Actually set version for podman module / pypodman
2018-11-27 04:08:08 -08:00
OpenShift Merge Robot e679e768f1
Merge pull request #1832 from giuseppe/always-make-explicit-tty-to-exec
exec: always make explicit the tty value
2018-11-27 04:08:03 -08:00
OpenShift Merge Robot 5636066e2f
Merge pull request #1871 from ypu/ip-test
Add some tests for --ip flag with run and create command
2018-11-27 03:46:13 -08:00
Giuseppe Scrivano 070ce0c855
exec: don't wait for pidfile when the runtime exited
don't wait for the timeout to expire if the runtime process exited.
I've noticed podman to hang on exit and keeping the container lock
taken when the OCI runtime already exited.

Additionally, it reduces the waiting time as we won't hit the 25
milliseconds waiting time in the worst case.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-27 12:34:11 +01:00
OpenShift Merge Robot 049defa984
Merge pull request #1850 from vrothberg/mount-propagation
set root propagation based on volume properties
2018-11-27 03:29:17 -08:00
OpenShift Merge Robot 1d3e24239a
Merge pull request #1734 from rhatdan/network
libpod should know if the network is disabled
2018-11-27 03:29:07 -08:00
Yiqiao Pu 1a217b6aa1 Remove mount options relatime from podman run --mount with shared
In some test env, mount with shared options is not included relatime
in the mountinfo file. So remove this from the test case.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-27 16:38:41 +08:00
Yiqiao Pu 883f814cfb Update test case name to podman run with --mount flag
Update the test case name to make it easier to filter --mount related
test cases with -ginkgo.focus.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-27 15:59:55 +08:00
Yiqiao Pu d9adcd198f Add some tests for --ip flag with run and create command
Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-27 15:09:47 +08:00
OpenShift Merge Robot 39560500fc
Merge pull request #1868 from QiWang19/issue860
Add history field to image inspect
2018-11-26 16:46:22 -08:00