Commit Graph

5259 Commits

Author SHA1 Message Date
OpenShift Merge Robot
42e080bcd3 Merge pull request #4043 from haircommander/preserve-fd-fix
exec: fix --preserve-fds
2019-09-16 23:23:59 +02:00
OpenShift Merge Robot
2a4e062c71 Merge pull request #3941 from gabibeyer/fix_unit_test
fix unit test using strings.Contains
2019-09-16 22:24:05 +02:00
OpenShift Merge Robot
0014d6cf6d Merge pull request #4038 from giuseppe/enable-sandbox-slirp4netns
networking: use --enable-sandbox if available
2019-09-16 22:03:49 +02:00
Peter Hunt
5f97721afc exec: fix --preserve-fds
There were two problems with preserve fds.
libpod didn't open the fds before passing _OCI*PIPE to conmon. This caused libpod to talk on the preserved fds, rather than the pipes, with conmon talking on the pipes. This caused a hang.
Libpod also didn't convert an int to string correctly, so it would further fail.

Fix these and add a unit test to make sure we don't regress in the future

Note: this test will not pass on crun until crun supports --preserve-fds

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-09-16 15:27:00 -04:00
OpenShift Merge Robot
1f5514ea55 Merge pull request #4031 from QazerLab/master
Skip spec_test for rootless envs without cgroup v2.
2019-09-16 17:00:36 +02:00
Giuseppe Scrivano
7c3428de26 networking: use --enable-sandbox if available
if slirp4netns supports sandboxing, enable it.

It automatically creates a new mount namespace where slirp4netns will
run and have limited access to the host resources.

It needs slirp4netns 0.4.1.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-16 16:42:11 +02:00
Danila Kiver
c06661f041 Check for rootless before checking cgroups version in spec_test.
Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
2019-09-15 21:28:13 +03:00
OpenShift Merge Robot
a1970e1915 Merge pull request #4026 from rhatdan/copy
Fix default to pause in podman cp
2019-09-14 11:32:31 +02:00
OpenShift Merge Robot
2366fd7ac6 Merge pull request #4030 from mheon/release_notes_1.6.0
Update release notes for v1.6.0
2019-09-14 02:59:44 +02:00
Danila Kiver
8ac57b48e1 Skip spec_test for rootless envs without cgroup v2.
Signed-off-by: Danila Kiver <danila.kiver@mail.ru>
2019-09-14 00:22:16 +03:00
Daniel J Walsh
a481a1265a Fix default to pause in podman cp
We want to default to secure when running containers as root,
in rootless, we need to change the default if the system does not
support cgroup v1.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-13 16:43:50 -04:00
Matthew Heon
4c2694fc98 Update release notes for v1.6.0
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-13 15:31:13 -04:00
OpenShift Merge Robot
0079c24ec1 Merge pull request #4023 from TomSweeneyRedHat/dev/tsweeney/buildah1.11.2_vendor
Vendor Buildah 1.11.2
2019-09-13 21:08:05 +02:00
OpenShift Merge Robot
d74cedefbd Merge pull request #4022 from baude/remotepushgetrt
get runtime for podman-remote push earlier
2019-09-13 18:55:47 +02:00
OpenShift Merge Robot
9b83882114 Merge pull request #4018 from giuseppe/fix-error-message-rootless
rootless: report the correct error
2019-09-13 18:44:52 +02:00
OpenShift Merge Robot
e8a44ebd46 Merge pull request #4006 from rhatdan/rootless
Report errors when trying to pause rootless containers
2019-09-13 18:44:45 +02:00
OpenShift Merge Robot
7875e00c66 Merge pull request #3934 from rhatdan/wait
Podman-remote run should wait for exit code
2019-09-13 18:12:25 +02:00
TomSweeneyRedHat
440392d37b Vendor Bulidah 1.11.2
Vendor in Buildah 1.11.2 into libpod/Podman

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-09-13 11:22:14 -04:00
baude
5539a2a228 get runtime for podman-remote push earlier
to prevent client side panics, we should get the runtime earlier in the
process of push.

Fixes: #4013

Signed-off-by: baude <bbaude@redhat.com>
2019-09-13 10:07:19 -05:00
OpenShift Merge Robot
5c09c4d294 Merge pull request #3942 from jwhonce/issue/3829
Stop glob'ing on podman cp
2019-09-13 16:36:21 +02:00
Giuseppe Scrivano
466694b881 rootless: report the correct error
do not shadow the err variable so that the correct error message can
be reported when utils.RunUnderSystemdScope fails.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-13 14:59:07 +02:00
Daniel J Walsh
88ebc33840 Report errors when trying to pause rootless containers
If you are running a rootless container on cgroupV1
you can not pause the container.  We need to report the proper error
if this happens.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-13 08:29:46 -04:00
Jhon Honce
a6836eae52 Do not support wildcards on cp
* symlink processing and wildcarding led to unexpected files
  being copied

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-12 16:56:38 -07:00
OpenShift Merge Robot
b095d8a794 Merge pull request #4010 from haircommander/regsiter-later
exec: Register resize func a bit later
2019-09-13 00:55:10 +02:00
OpenShift Merge Robot
b43a36d7a3 Merge pull request #3978 from baude/networkremove
enhance podman network rm
2019-09-12 23:58:50 +02:00
OpenShift Merge Robot
20772182e6 Merge pull request #4009 from baude/execrmsocket
clean up after healthcheck execs
2019-09-12 23:23:08 +02:00
OpenShift Merge Robot
1ddfc11764 Merge pull request #3986 from debarshiray/wip/rishi/test-podman-exec-tty-onlcr
Test that PTYs created by 'podman exec --tty' have the ONLCR flag
2019-09-12 23:08:53 +02:00
gabi beyer
69c58236ae fix unit test to use Expect
The Expect function does not return a result of True or False
depending on the value of the first instance, but instead requires
a comparison using ".To(", so change to use ".To(ContainSubstring("

Signed-off-by: gabi beyer <gabrielle.n.beyer@intel.com>
2019-09-12 21:01:43 +00:00
OpenShift Merge Robot
6ad17623d5 Merge pull request #3998 from cevich/idiot_proof_systemd_unit
Prevent podman varlink socket fight
2019-09-12 22:54:37 +02:00
OpenShift Merge Robot
3acfc3b7df Merge pull request #3997 from QiWang19/sigpath
fix podman sign signature store for rootless
2019-09-12 22:23:29 +02:00
OpenShift Merge Robot
42332a3ea2 Merge pull request #3989 from mheon/storage_containers_add_info
Add further fields to StorageContainer
2019-09-12 22:23:17 +02:00
Daniel J Walsh
82ac0d8925 Podman-remote run should wait for exit code
This change matches what is happening on the podman local side
and should eliminate a race condition.

Also exit commands on the server side should start to return to client.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-12 16:20:01 -04:00
Daniel J Walsh
535111b5d5 Use exit code constants
We have leaked the exit number codess all over the code, this patch
removes the numbers to constants.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-12 16:20:01 -04:00
Peter Hunt
1dcb771dbd exec: Register resize func a bit later
if we register the resize func too early, it attempts to read from the 'ctl' file before it exists. this causes the func to error, and the resize to not go through.

Fix this by registering resize func later for conmon. This, along with a conmon fix, will allow exec to know the terminal size at startup

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-09-12 16:14:30 -04:00
baude
7b68cd0b3d clean up after healthcheck execs
when executing a healthcheck, we were not cleaning up after exec's use
of a socket.  we now remove the socket file and ignore if for reason it
does not exist.

Fixes: #3962

Signed-off-by: baude <bbaude@redhat.com>
2019-09-12 14:30:46 -05:00
baude
b94ea07265 enhance podman network rm
when removing a podman network, we need to make sure we delete the
network interface if one was ever created (by running a container).
also, when removing networks, we check if any containers are using the
network.  if they are, we error out unless the user provides a 'force'
option which will remove the containers in question.

Signed-off-by: baude <bbaude@redhat.com>
2019-09-12 14:03:52 -05:00
OpenShift Merge Robot
af8fedcc78 Merge pull request #3999 from jwhonce/wip/msi
Support building Windows msi file
2019-09-12 19:44:35 +02:00
OpenShift Merge Robot
8c3349bc08 Merge pull request #3959 from giuseppe/rootless-use-systemd-scope
rootless: automatically create a systemd scope
2019-09-12 19:04:07 +02:00
OpenShift Merge Robot
2de4987086 Merge pull request #4004 from giuseppe/fix-private-cgroup-systemd
linux: fix systemd with --cgroupns=private
2019-09-12 18:51:55 +02:00
Jhon Honce
046c081ed0 Add podman icon to installer
Update Makefile per review comments

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-12 09:35:54 -07:00
Debarshi Ray
137ec81634 Test that PTYs created by 'podman exec --tty' have the ONLCR flag
Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2019-09-12 18:34:56 +02:00
Chris Evich
9be2a6f908 Prevent podman varlink socket fight
When enabled, it's desired for the podman-varlink process to startup on
boot or upon socket-activation, whichever happens first.  However,
with `KillMode=none` systemd will never kill any podman-varlink
processes.  This makes it easily possible for multiple podman-varlink
processes to be running, and fight each other to service a single socket.

---
For example:

Prior to this commit, this will result in four podman-varlink processes
being run:

```
systemctl enable io.podman.socket
systemctl enable io.podman.service
systemctl start io.podman.socket
systemctl start io.podman.service
systemctl start io.podman.service
```

Fix this by setting `KillMode=process` and `TimeoutStopSec=30` (default
is 90).  This results in podman-varlink exiting on its own after a minute
of being idle (--timeout=60000).  Alternatively, systemd will manage the
service stop by sending a SIGTERM, then if podman-varlink has not exited
within `TimeoutStopSec`, a SIGKILL will be sent.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-09-12 11:21:20 -04:00
OpenShift Merge Robot
afa3d11381 Merge pull request #4003 from TomSweeneyRedHat/dev/tsweeney/rootlessup2
Touch up some bad grammar in rootless doc
2019-09-12 15:39:45 +02:00
TomSweeneyRedHat
b1e36204b3 Touch up some bad grammar in rootless doc
After my last update for the 'Shortcomings of Rootless Podman' was merged,
I spotted a few grammatical nits that this corrects.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-09-12 08:34:08 -04:00
Giuseppe Scrivano
a249c98db8 linux: fix systemd with --cgroupns=private
When --cgroupns=private is used we need to mount a new cgroup file
system so that it points to the correct namespace.

Needs: https://github.com/containers/crun/pull/88

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-12 14:33:26 +02:00
OpenShift Merge Robot
57e093b3ae Merge pull request #3994 from cevich/fix_img_build_sebool
Cirrus: Fix unnecessary setsebool
2019-09-12 14:01:05 +02:00
OpenShift Merge Robot
ce31aa37d6 Merge pull request #3968 from TomSweeneyRedHat/dev/tsweeney/rootlessup
Add cgroup v2 info to rootless tutorial
2019-09-12 10:20:34 +02:00
OpenShift Merge Robot
65114a6881 Merge pull request #3996 from rhatdan/trust
podman-remote image trust is broken
2019-09-12 10:04:03 +02:00
Giuseppe Scrivano
7e88bf7fd0 rootless: run pause process in its own scope
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-12 08:35:27 +02:00
Giuseppe Scrivano
afd0818326 rootless: automatically create a systemd scope
when running in rootless mode and using systemd as cgroup manager
create automatically a systemd scope when the user doesn't own the
current cgroup.

This solves a couple of issues:

on cgroup v2 it is necessary that a process before it can moved to a
different cgroup tree must be in a directory owned by the unprivileged
user.  This is not always true, e.g. when creating a session with su
-l.

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

Also, for running systemd in a container it was before necessary to
specify "systemd-run --scope --user podman ...", now this is done
automatically as part of this PR.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-12 08:35:26 +02:00