2277 Commits

Author SHA1 Message Date
d346996e15 Merge pull request #1849 from giuseppe/report-rootless-netmode
rootless: add new netmode "slirp4netns"
2018-11-28 06:18:28 -08:00
2a496aea30 Merge pull request #1833 from giuseppe/remove-exec-polling
exec: remove polling for PID file
2018-11-28 05:10:49 -08:00
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
6688e9bc14 Merge pull request #1837 from giuseppe/vndr-selinux
vendor: update selinux
2018-11-28 04:43:36 -08:00
dd315cc043 Merge pull request #1861 from giuseppe/fix-rootless-cleanup
rootless: fix cleanup
2018-11-28 04:27:37 -08:00
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
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
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
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
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
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
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
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
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
3f0c0cf80f Merge pull request #1874 from ypu/mount-test
Improve podman run --mount test
2018-11-27 04:30:02 -08:00
c1489e6317 Merge pull request #1863 from afbjorklund/podman_version
Actually set version for podman module / pypodman
2018-11-27 04:08:08 -08:00
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
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
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
049defa984 Merge pull request #1850 from vrothberg/mount-propagation
set root propagation based on volume properties
2018-11-27 03:29:17 -08:00
1d3e24239a Merge pull request #1734 from rhatdan/network
libpod should know if the network is disabled
2018-11-27 03:29:07 -08:00
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
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
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
39560500fc Merge pull request #1868 from QiWang19/issue860
Add history field to image inspect
2018-11-26 16:46:22 -08:00
392648e7bc Merge pull request #1838 from umohnani8/vendor
Vendor in latest containers/buildah
2018-11-26 12:25:18 -08:00
f4db780bea Merge pull request #1865 from baude/exists
add podman container|image exists
2018-11-26 10:03:37 -08:00
5438ec1918 Add history and namespaceoptions to image inspect
Signed-off-by: Qi Wang <qiwan@redhat.com>
2018-11-26 10:56:55 -05:00
9d883d2032 add podman container|image exists
Add an exists subcommand to podman container and podman image that allows
users to verify the existence of a container or image by ID or name.  The return
code can be 0 (success), 1 (failed to find), or 125 (failed to work with runtime).

Issue #1845

Signed-off-by: baude <bbaude@redhat.com>
2018-11-26 09:19:39 -06:00
0e2042ebd7 set root propagation based on volume properties
Set the root propagation based on the properties of volumes and default
mounts.  To remain compatibility, follow the semantics of Docker.  If a
volume is shared, keep the root propagation shared which works for slave
and private volumes too.  For slave volumes, it can either be shared or
rshared.  Do not change the root propagation for private volumes and
stick with the default.

Fixes: #1834
Signed-off-by: Valentin Rothberg <vrothberg@suse.com>
2018-11-26 13:55:02 +01:00
e3ece3bb90 Merge pull request #1860 from TomasTomecek/version-add-format
implement --format for version command
2018-11-25 04:52:38 -08:00
f84452f411 Actually set version for podman module / pypodman
The environment variable wasn't set, giving 0.0.0

It is a still a problem if you use python3 to build,
rather than make. You *need* to set $PODMAN_VERSION,
or your module and packages won't have the version.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2018-11-25 13:50:19 +01:00
5f8f15c797 Merge pull request #1862 from elimisteve/patch-1
podman_tutorial.md typo: arguement -> argument
2018-11-25 04:43:37 -08:00
43c20d0200 implement --format for version command
Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2018-11-25 12:42:05 +01:00
22d971cd75 podman_tutorial.md typos: arguement -> argument; missing 'a'
Signed-off-by: Steve Phillips <steve@tryingtobeawesome.com>
2018-11-24 16:08:58 -08:00
78604c3c39 Merge pull request #1858 from adrianreber/papr
Load NAT modules to fix tests involving CRIU
2018-11-23 12:33:39 -08:00
90412e4c56 Load NAT modules to fix tests involving CRIU
CRIU uses iptables to lock and unlock the network during checkpoint and
restore. If Podman is running in Podman the automatic loading of modules
does not work and thus this commit pre-loads the necessary modules to
make sure the checkpoint test cases are not failing.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-23 19:09:48 +01:00
1fdfeb8710 Merge pull request #1835 from adrianreber/master
Added option to keep container running after checkpointing
2018-11-21 05:11:12 -08:00
bd61c779ca Vendor in latest containers/buildah
Pulls in fix for COPY --from when using --layers

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2018-11-21 12:38:14 +00:00
23feb0d6f9 Merge pull request #1810 from baude/inspectToKube
generate kubernetes YAML from a libpod container
2018-11-20 13:02:57 -08:00
fe4f09493f Merge pull request #1829 from baude/enableportbindinginpods
Allow users to expose ports from the pod to the host
2018-11-20 08:53:21 -08:00
21a76077d3 Merge pull request #1831 from jwhonce/wip/cmd
Improve speed of containers.list()
2018-11-20 08:32:16 -08:00
24c0739453 Update checkpoint/restore man pages
This adds the '--leave-running, -R' to the container-checkpoint man
page. As the information for '--all, -a' and '--latest, -l' was also
still missing it is included in this commit.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-20 17:25:44 +01:00
b0572d6229 Added option to keep containers running after checkpointing
CRIU supports to leave processes running after checkpointing:

  -R|--leave-running    leave tasks in running state after checkpoint

runc also support to leave containers running after checkpointing:

   --leave-running      leave the process running after checkpointing

With this commit the support to leave a container running after
checkpointing is brought to Podman:

   --leave-running, -R  leave the container running after writing checkpoint to disk

Now it is possible to checkpoint a container at some point in time
without stopping the container. This can be used to rollback the
container to an early state:

$ podman run --tmpfs /tmp --name podman-criu-test -d docker://docker.io/yovfiatbeb/podman-criu-test
$ curl 10.88.64.253:8080/examples/servlets/servlet/HelloWorldExample
3
$ podman container checkpoint -R -l
$ curl 10.88.64.253:8080/examples/servlets/servlet/HelloWorldExample
4
$ curl 10.88.64.253:8080/examples/servlets/servlet/HelloWorldExample
5
$ podman stop -l
$ podman container restore -l
$ curl 10.88.64.253:8080/examples/servlets/servlet/HelloWorldExample
4

So after checkpointing the container kept running and was stopped after
some time. Restoring this container will restore the state right at the
checkpoint.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-20 17:25:44 +01:00
ff47a4c2d5 Use a struct to pass options to Checkpoint()
For upcoming changes to the Checkpoint() functions this commit switches
checkpoint options from a boolean to a struct, so that additional
options can be passed easily to Checkpoint() without changing the
function parameters all the time.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-11-20 17:25:44 +01:00
fd01402930 exec: always make explicit the tty value
otherwise runc will take by default the value used for creating the
container.  Setting it explicit overrides its default value and we
won't end up trying to use a terminal when not available.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1625876

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-20 17:08:57 +01:00
690c52a113 Allow users to expose ports from the pod to the host
we need to allow users to expose ports to the host for the purposes
of networking, like a webserver.  the port exposure must be done at
the time the pod is created.

strictly speaking, the port exposure occurs on the infra container.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-20 09:49:34 -06:00
e955ff04ab Improve speed of containers.list()
* Clean up code in containers.py
* Pass pylint tests
* Pass tox tests

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-19 15:39:45 -07:00
ea928f2de6 Merge pull request #1824 from afbjorklund/pypodman_user
pypodman: Don't use $HOST and $USER variables for remote
2018-11-19 08:45:06 -08:00
64a29e383b Merge pull request #1806 from giuseppe/rootless-create-default-files
rootless: create user conf files when they don't exist
2018-11-19 08:44:57 -08:00