6495 Commits

Author SHA1 Message Date
8eaa11e8b2 Upgrade make package-install for fedora31
The package golang-github-cpuguy83-go-md2man has been renamed into golang-github-cpuguy83-md2man
in f31 repository.

That leads to an Error: Unable to find a match: golang-github-cpuguy83-go-md2man
This patch handles the renaming of this package and fixes the command for f31 and the one that will
follows without breaking compatibility with older versions.

Signed-off-by: Allan Jacquet-Cretides <allan.jacquet@gmail.com>
2020-02-21 13:57:17 +01:00
92dbcb8841 Merge pull request #5217 from mheon/rework_label_parsing
Rework label parsing
2020-02-15 12:50:48 +01:00
36a0ed9702 Rework label parsing
We attempted to share all logic for parsing labels and
environment variables, which on the surface makes lots of sense
(both are formatted key=value so parsing logic should be
identical) but has begun to fall apart now that we have added
additional logic to environment variable handling. Environment
variables that are unset, for example, are looked up against
environment variables set for the process. We don't want this for
labels, so we have to split parsing logic.

Fixes #3854

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-14 16:06:20 -05:00
9e9b157aa9 Merge pull request #5214 from baude/apiv2loglibpod
apiv2 libpod container logs
2020-02-14 21:21:35 +01:00
97fdfd0a80 Merge pull request #5208 from containers/dependabot/go_modules/github.com/rootless-containers/rootlesskit-0.8.0
build(deps): bump github.com/rootless-containers/rootlesskit from 0.7.2 to 0.8.0
2020-02-14 21:06:51 +01:00
a07e5e73a6 Merge pull request #5199 from leorochael/patch-1
Enhance fuse-overlayfs instructions.
2020-02-14 21:06:44 +01:00
ca303586b3 Merge pull request #5216 from baude/bindingstestcache
add caching for binding tests
2020-02-14 20:49:54 +01:00
3e0088ce7c Merge pull request #5207 from rhatdan/selinux
Fix SELinux labels of volumes
2020-02-14 20:49:45 +01:00
7e713ff336 Merge pull request #5209 from vrothberg/un-docker
Undocker part 1)
2020-02-14 20:13:28 +01:00
0668483cf0 Merge pull request #5203 from QiWang19/disable-detach-key
fix bug "" disable detach keys
2020-02-14 20:13:20 +01:00
08bb9317cb add caching for binding tests
add the ability to cache images instead of pull them.  makes tests faster and less network use when we flip on CI.

Also added list images with filter test

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-14 12:11:23 -06:00
c2ea27dec0 Merge pull request #5058 from phpor/master
Fixed a bug about bash automatically complete
2020-02-14 17:49:29 +01:00
0e644933ff Merge pull request #5192 from kolyshkin/man
podman-run(1): fixes
2020-02-14 17:28:51 +01:00
b1034eabe3 apiv2 libpod container logs
wire up containers logs for libpod side of the house, same as compat.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-14 10:18:17 -06:00
85b7374491 add pkg/signal
Add pkg/signal to deal with parts of signal processing and translating
signals from string to numeric representations.  The code has been
copied from docker/docker (and attributed with the copyright) but been
reduced to only what libpod needs (on Linux).

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-14 15:04:14 +01:00
156ce5cd7d add pkg/capabilities
Add pkg/capabibilities to deal with capabilities.  The code has been
copied from Docker (and attributed with the copyright) but changed
significantly to only do what we really need.  The code has also been
simplified and will perform better due to removed redundancy.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-14 12:00:45 +01:00
d26edff820 build(deps): bump github.com/rootless-containers/rootlesskit
Bumps [github.com/rootless-containers/rootlesskit](https://github.com/rootless-containers/rootlesskit) from 0.7.2 to 0.8.0.
- [Release notes](https://github.com/rootless-containers/rootlesskit/releases)
- [Commits](https://github.com/rootless-containers/rootlesskit/compare/v0.7.2...v0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-14 11:50:01 +01:00
b4fa6f4f08 Fix SELinux labels of volumes
If we attempt to label a volume and the file system
does not support labeling, then just warn.  SELinux
may or may not work, on the volume.

There is no way to setup a private label on a newly
created volume without using the container mountlabel.

If we don't have a mount label at the time of creation of
the volume, the only option we have is to create a shared
label.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-13 21:42:57 -05:00
3fd9f0c028 podman(1): fixes
I saw some bad formatting when reading "man podman-run" and
proceeded to fix it. I have now opened a can of worms...

This commit tries to fix some of the formatting, wording and
other bugs I came across (unfortunately not all of them).

Can't list every fix that I made here, but in general:
- format lists as such (prepend items with "- ");
- format examples as such (enclose in ```...```);
- format literal values (option names, literal values) as **bold**;
- format man page references as **page**(1).
- format replacements (option values) and file names as _italic_;
- remove some duplicate info (such as what's the default value);
- move option value description to option syntax;
- end sentences with a period.

To test:
```console
$ make docs
$ man ./docs/build/man/podman-run.1 ### check terminal formatting
$ man -Tps ./docs/build/man/podman-run.1 > podman-run.ps
$ ps2pdf podman-run.ps ### optional
$ evince podman-run.pdf ### check printer formatting (or use ps viewr
```

NOTE
 - there is much more to do here;
 - I haven't checked any factual contents, this is about formatting

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-02-13 16:28:31 -08:00
0c060dace1 Merge pull request #5190 from baude/apiv2cockpit3
filtering behavior correction
2020-02-14 00:32:33 +01:00
1b290f995b Merge pull request #5074 from jwhonce/wip/swagger_endpoint
Add /swagger/ endpoint to serve swagger yaml to clients
2020-02-14 00:32:26 +01:00
ebfd253fc6 fix bug "" disable detach keys
fix #5166
This patch enables `--detach-keys ""` to disable the feature. "ctrl-p, ctrl-q" will not work after this command.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-02-13 16:57:13 -05:00
3e0475eb88 Merge pull request #5189 from mheon/only_set_all_on_status
Only set --all when a status filter is given to ps
2020-02-13 20:51:22 +01:00
27f861f785 Fixed a bug about bash automatically complete
When I input podman start in bash , and then type tab , cannot automatically complete container name , this pr will fix the bug .

Signed-off-by: 李俊杰 <phpor@users.noreply.github.com>
2020-02-14 00:10:37 +08:00
9abfc32e05 Enhance fuse-overlayfs instructions.
The `fuse-overlayfs` package provided by Ubuntu up to 19.10,  is not
recent enough and causes errors on `buildah commit`, for instance.

Adjust the rootless tutorial to point this out and to provide more
detailed instructions on how to obtain `fuse-overlayfs` and configure it
for use by `libpod`.

Signed-off-by: Leonardo Rochael Almeida <leorochael@gmail.com>
2020-02-13 12:58:05 -03:00
e4e5efc12b Merge pull request #5195 from vrothberg/fix-5106
[CI:DOCS] README: fix docs links
2020-02-13 16:00:51 +01:00
cd9e6b4143 Merge pull request #5172 from giuseppe/api-fix-cpu-stats
api: fix the CPU stats reported
2020-02-13 15:42:53 +01:00
f8443eb83a README: fix docs links
Fix: #5106
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-13 14:28:58 +01:00
f4b5e600a1 Merge pull request #5179 from containers/dependabot/go_modules/k8s.io/api-0.17.3
build(deps): bump k8s.io/api from 0.17.2 to 0.17.3
2020-02-13 13:45:00 +01:00
d6ba8b4110 Merge pull request #5177 from rhatdan/kube
Fix up play kube to use image data
2020-02-13 13:09:07 +01:00
5418c9c06b Fix up play kube to use image data
podman play kube was ignoring the
imageData.Config
   Volumes
   WorkingDir
   Labels
   StopSignal

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-13 05:46:27 -05:00
2814995a92 Merge pull request #5115 from QiWang19/images-format
images --format compatible with docker
2020-02-13 11:42:47 +01:00
990a4fb57e build(deps): bump k8s.io/api from 0.17.2 to 0.17.3
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.17.2 to 0.17.3.
- [Release notes](https://github.com/kubernetes/api/releases)
- [Commits](https://github.com/kubernetes/api/compare/v0.17.2...v0.17.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-13 10:11:26 +01:00
a9969c23a3 Merge pull request #5191 from baude/fedoraminimaliskillingme
use quay.io/libpod/fedora-minimal for reliability
2020-02-13 04:56:28 +01:00
5ea6cad20c Merge pull request #5183 from giuseppe/rootlessport-avoid-hang
rootlessport: fix potential hang
2020-02-13 02:50:41 +01:00
c16e12f6c5 Merge pull request #5181 from containers/dependabot/go_modules/github.com/gorilla/mux-1.7.4
build(deps): bump github.com/gorilla/mux from 1.7.3 to 1.7.4
2020-02-13 02:34:57 +01:00
502a87a1b1 Merge pull request #5180 from containers/dependabot/go_modules/k8s.io/apimachinery-0.17.3
build(deps): bump k8s.io/apimachinery from 0.17.2 to 0.17.3
2020-02-13 02:34:50 +01:00
a65f6b888a Merge pull request #5152 from QiWang19/device-cgroup-rule
support device-cgroup-rule
2020-02-13 02:34:42 +01:00
d2100cd473 Only set --all when a status filter is given to ps
The changes in #5075 turn out to be too aggressive; we should
only be setting --all if a status= filter is given. Otherwise
only running containers are filtered.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-12 20:14:20 -05:00
2aacfade75 use quay.io/libpod/fedora-minimal for reliability
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-12 16:45:03 -06:00
ce7c9c998c filtering behavior correction
when filtering containers, if a status= is provided as an input filter, then we should override the all to always be true.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-12 16:08:07 -06:00
2281cbdd6d Merge pull request #5171 from baude/apiv2cockpit2
Fix container filters
2020-02-12 22:43:59 +01:00
d3260738d3 support device-cgroup-rule
fix #4876
Add `--device-cgroup-rule` to podman create and run. This enables to add device rules after the container has been created.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-02-12 14:30:23 -05:00
e74ad35963 Merge pull request #5187 from vrothberg/pkg-seccomp
add pkg/seccomp
2020-02-12 19:13:23 +01:00
5b69e7f2ef rootlessport: drop Pdeathsig in favor of Kill
there is a race condition where the child process is immediately
killed:

[pid 2576752] arch_prctl(0x3001 /* ARCH_??? */, 0x7ffdf612f170) = -1 EINVAL (Invalid argument)
[pid 2576752] access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
[pid 2576752] --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=2576742, si_uid=0} ---
[pid 2576752] +++ killed by SIGTERM +++

this happens because the parent process here really means the "parent
thread".

Since there is no way of running it on the main thread,
let's skip this functionality altogether and use kill(2).

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-12 18:48:42 +01:00
dd5df42be9 Merge pull request #5168 from mheon/do_not_overwrite_volumes
Do not copy up when volume is not empty
2020-02-12 18:46:35 +01:00
2550ded989 rootlessport: fix potential hang
write to the error pipe only in case of an error.  Otherwise we may
end up in a race condition in the select statement below as the read
from errChan happens before initComplete and the function returns
immediately nil.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-12 18:13:30 +01:00
65d10ffab3 add pkg/seccomp
Add pkg/seccomp to consolidate all seccomp-policy related code which is
currently scattered across multiple packages and complicating the
creatconfig refactoring.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-12 17:10:18 +01:00
c140ecdc9b Do not copy up when volume is not empty
When Docker performs a copy up, it first verifies that the volume
being copied into is empty; thus, for volumes that have been
modified elsewhere (e.g. manually copying into then), the copy up
will not be performed at all. Duplicate this behavior in Podman
by checking if the volume is empty before copying.

Furthermore, move setting copyup to false further up. This will
prevent a potential race where copy up could happen more than
once if Podman was killed after some files had been copied but
before the DB was updated.

This resolves CVE-2020-1726.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-12 10:58:42 -05:00
0e9c637c42 Merge pull request #5185 from vrothberg/v2-pull-fix
[CI:DOCS] api: pull: fix reference parsing
2020-02-12 16:55:06 +01:00