5387 Commits

Author SHA1 Message Date
b095d8a794 Merge pull request #4010 from haircommander/regsiter-later
exec: Register resize func a bit later
2019-09-13 00:55:10 +02:00
b43a36d7a3 Merge pull request #3978 from baude/networkremove
enhance podman network rm
2019-09-12 23:58:50 +02:00
20772182e6 Merge pull request #4009 from baude/execrmsocket
clean up after healthcheck execs
2019-09-12 23:23:08 +02:00
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
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
6ad17623d5 Merge pull request #3998 from cevich/idiot_proof_systemd_unit
Prevent podman varlink socket fight
2019-09-12 22:54:37 +02:00
3acfc3b7df Merge pull request #3997 from QiWang19/sigpath
fix podman sign signature store for rootless
2019-09-12 22:23:29 +02:00
42332a3ea2 Merge pull request #3989 from mheon/storage_containers_add_info
Add further fields to StorageContainer
2019-09-12 22:23:17 +02:00
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
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
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
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
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
af8fedcc78 Merge pull request #3999 from jwhonce/wip/msi
Support building Windows msi file
2019-09-12 19:44:35 +02:00
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
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
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
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
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
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
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
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
57e093b3ae Merge pull request #3994 from cevich/fix_img_build_sebool
Cirrus: Fix unnecessary setsebool
2019-09-12 14:01:05 +02:00
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
65114a6881 Merge pull request #3996 from rhatdan/trust
podman-remote image trust is broken
2019-09-12 10:04:03 +02:00
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
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
b94a5e2410 utils: use the user session for systemd
when running as rootless, use the user session bus.  It is already
implemented in the pkg/cgroups so just re-use it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-09-12 08:35:26 +02:00
ecb958e598 Support building Windows msi file
* Update Makefile to build msi
* Add podman.wxs to define podman.msi
  * Version information provided by Makefile
* Add podman.bat wrapper for podman-remote-windows.exe to ensure environment
* Add wix xml schemas for reference

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-09-11 16:15:52 -07:00
6c702171da Add cgroup v2 info to rootless tutorial
Adding cgroup v2 information to the rootless tutorial.  Will post it to a Google Doc
to for easier review comments.

https://docs.google.com/document/d/1hrxU-CYhrKDjMf6cIRuegbyY9pkDv-AlEF-i0I8_kdk

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-09-11 17:15:52 -04:00
569c2e523d fix podman sign signature store for rootless
Store the the signature under graphroot when using rootless podman image sign.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-09-11 16:27:42 -04:00
10c293d7a9 podman-remote image trust is broken
We should not be making it available, it does nothing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-11 16:03:45 -04:00
866d4763a1 Cirrus: Fix unnecessary setsebool
By mistake this was added to run for the image-building-VM and is not
supported.  Kill it.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-09-11 14:03:20 -04:00
79ebb5f254 Merge pull request #3988 from mheon/fix_lookup_volume
Volume lookup needs to include state to unmarshal into
2019-09-11 18:17:30 +02:00
3c277a67d5 Add further fields to StorageContainer
This will be used when we allow 'podman ps' to display info on
storage containers instead of Libpod containers.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-09-11 10:53:21 -04:00
f73c3b868d Merge pull request #3973 from baude/validateupdate
add lint and manpage check to make validate
2019-09-11 16:45:55 +02:00
5ddfe5d95d Volume lookup needs to include state to unmarshal into
Lookup was written before volume states merged, but merged after,
and CI didn't catch the obvious failure here. Without a valid
state, we try to unmarshall into a null pointer, and 'volume rm'
is completely broken because of it.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-11 10:17:28 -04:00
093013b099 Merge pull request #3984 from mheon/prune_no_in_use_error
Do not prune images being used by a container
2019-09-11 15:31:15 +02:00
9cf852c305 Merge pull request #3927 from openSUSE/manager-annotations
Add `ContainerManager` annotation to created containers
2019-09-11 09:34:14 +02:00
7ac6ed3b4b Merge pull request #3581 from mheon/no_cgroups
Support running containers without CGroups
2019-09-11 00:58:46 +02:00
997c4b56ed Merge pull request #3961 from mheon/copy_volume_contents
When first mounting any named volume, copy up
2019-09-10 22:24:43 +02:00
a58ac7be7b Cirrus: Prevent resident pollution
When constructing VM cache-images, the latest/greatest podman package is
installed to ensure all necessary dependencies are met.  Prior to
testing source-built binaries, most of of the packaged files are removed.
However, if the `io.podman` service or socket is enabled/running, it
could cause the packaged podman and varlink binaries to be both resident
and cached.  Since this condition would cause very difficult to diagnose
behaviors, add preventative measures to ensure these services are absent
prior to removing packaged podman files.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-09-10 16:22:15 -04:00
3e92bcbf71 Do not prune images being used by a container
Podman is not the only user of containers/storage, and as such we
cannot rely on our database as the sole source of truth when
pruning images. If images do not show as in use from Podman's
perspective, but subsequently fail to remove because they are
being used by a container, they're probably being used by Buildah
or another c/storage client.

Since the images in question are in use, we shouldn't error on
failure to prune them - we weren't supposed to prune them in the
first place.

Fixes: #3983

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-10 13:30:50 -04:00
c1761ba1ac Merge pull request #3817 from xcffl/master
Add explanation mounting named volumes for `podman run`
2019-09-10 19:17:39 +02:00
095647cd6f Merge pull request #3966 from cfelder/fixup-makefile-bsd
Fixup Makefile for BSD systems, e.g. macOS
2019-09-10 17:19:06 +02:00
c2284962c7 Add support for launching containers without CGroups
This is mostly used with Systemd, which really wants to manage
CGroups itself when managing containers via unit file.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-10 10:52:37 -04:00
52335367bc Merge pull request #3964 from TomSweeneyRedHat/dev/tsweeney/journaldimgfix
Turn off journald in podmanimages on quay.io
2019-09-10 15:03:16 +02:00
ba7e863ac3 add lint and manpage check to make validate
make validate now runs golangci-lint and the man-page-checker to ensure
a PR is ready for our CI system.

Signed-off-by: baude <bbaude@redhat.com>
2019-09-10 05:45:59 -05:00
df036f9f8e Add ContainerManager annotation to created containers
This change adds the following annotation to every container created by
podman:

```json
"Annotations": {
    "io.containers.manager": "libpod"
}
```

Target of this annotaions is to indicate which project in the containers
ecosystem is the major manager of a container when applications share
the same storage paths. This way projects can decide if they want to
manipulate the container or not. For example, since CRI-O and podman are
not using the same container library (libpod), CRI-O can skip podman
containers and provide the end user more useful information.

A corresponding end-to-end test has been adapted as well.

Relates to: https://github.com/cri-o/cri-o/pull/2761

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-09-10 09:37:14 +02:00
b6106341fb When first mounting any named volume, copy up
Previously, we only did this for volumes created at the same time
as the container. However, this is not correct behavior - Docker
does so for all named volumes, even those made with
'podman volume create' and mounted into a container later.

Fixes #3945

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-09-09 17:17:39 -04:00