Commit graph

8750 commits

Author SHA1 Message Date
Valentin Rothberg 2b6dd3fb43 podman.service: use default killmode
Do not set the killmode to process as it only kills the main process and
leaves other processes untouched.  Just remove the line and use the
default cgroup killmode which will kill all processes in the service's
cgroup.

Fixes: #7021
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:40:46 +02:00
Valentin Rothberg 2e6946c777 podman.service: remove stop timeout
Remove the stop timeout from the unit.  As unit does not specify any
stop command, the timeout is effectively 0 and a NOOP.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:40:46 +02:00
Valentin Rothberg d856e87f40 events endpoint: fix panic and race condition
Fix a potential panic in the events endpoint when parsing the filters
parameter.  Values of the filters map might be empty, so we need to
account for that instead of uncondtitionally accessing the first item.

Also apply a similar for race conditions as done in commit f4a2d25c0f:

	Fix a race that could cause read errors to be masked.  Masking
	such errors is likely to report red herrings since users don't
	see that reading failed for some reasons but that a given event
	could not be found.

Another race was the handler closing event channel, which could lead to
two kinds of panics: double close, send to close channel.  The backend
takes care of that.  However, make sure that the backend stops working
in case the context has been cancelled.

Fixes: #6899
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:37:05 +02:00
Valentin Rothberg 9312d458b4 systemd: symlink user->system
Symlink the user to the system services in `contrib/systemd`.
There is no diference between the services, so we can reduce
redundancy while not breaking downstream packages which might
already be referencing `./contrib/systemd/user`.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-20 11:12:41 +02:00
Paul Holzinger 67a5e21bf8 fix: system df error when an image has no name
When an image has no name/tag system df will
error because it tries to parse an empty name.

This commit makes sure we only parse non
empty names and set the repository and tag
to "<none>" otherwise.

Closes #7015

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-07-19 22:55:27 +02:00
OpenShift Merge Robot b7b8fce826
Merge pull request #7011 from rhatdan/troubleshoot
document CAP_SYS_ADMIN required for systemd PrivateNetwork
2020-07-19 09:05:52 -04:00
OpenShift Merge Robot d087adeb87
Merge pull request #6402 from alvistack/master-linux-amd64
[nix] Cleanup nix derivation for static builds
2020-07-18 08:29:16 -04:00
Daniel J Walsh 94d9add4eb
document CAP_SYS_ADMIN required for systemd PrivateNetwork
Signed-off-by: James Cassell <code@james.cassell.me>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-18 06:30:28 -04:00
OpenShift Merge Robot deff289a9f
Merge pull request #6934 from ParkerVR/tags-reference
using reference package to parse
2020-07-18 06:23:17 -04:00
Wong Hoi Sing Edison f53812a11e
Cleanup nix derivation for static builds
Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
2020-07-18 09:03:28 +08:00
OpenShift Merge Robot 10c5f24123
Merge pull request #7005 from giuseppe/set-umask-rlimits
abi: set default umask and rlimits
2020-07-17 16:12:47 -04:00
Parker Van Roy 809a50f94d Used reference package with errors for parsing tag
Signed-off-by: Parker Van Roy <pvanroy@redhat.com>
2020-07-17 15:54:21 -04:00
Giuseppe Scrivano 65d382dc68
abi: set default umask and rlimits
the code got lost in the migration to podman 2.0, reintroduce it.

Closes: https://github.com/containers/podman/issues/6989

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-17 20:53:38 +02:00
OpenShift Merge Robot dfca83d37c
Merge pull request #7000 from containers/dependabot/go_modules/github.com/containers/common-0.16.0
Bump github.com/containers/common from 0.15.2 to 0.16.0
2020-07-17 05:43:28 -04:00
OpenShift Merge Robot d86bae2a01
Merge pull request #6965 from giuseppe/followup-pr6324
allow switching of port-forward approaches in rootless/using slirp4netns
2020-07-17 04:44:49 -04:00
OpenShift Merge Robot 0bd5181942
Merge pull request #6963 from containers/dependabot/go_modules/github.com/uber/jaeger-client-go-2.25.0incompatible
Bump github.com/uber/jaeger-client-go from 2.24.0+incompatible to 2.25.0+incompatible
2020-07-16 17:18:10 -04:00
OpenShift Merge Robot 8c59e3f6e8
Merge pull request #7003 from mheon/404_on_noimage
The compat create endpoint should 404 on no such image
2020-07-16 17:14:50 -04:00
Giuseppe Scrivano d35d8125bf
docs: document the new slirp4netns options
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-16 22:37:28 +02:00
Giuseppe Scrivano 7722b582b4
network, slirp4netns: add option to allow host loopback
Closes: https://github.com/containers/podman/issues/6912

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-16 22:37:27 +02:00
Giuseppe Scrivano 9be7029cdd
libpod: pass down network options
do not pass network specific options through the network namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-16 22:37:27 +02:00
Matthew Heon fc81d2acea The compat create endpoint should 404 on no such image
This matches Docker behavior, and will make the Docker frontend
work with `podman system service` (Docker tries to create, then
if that fails with 404 sends a request to pull the image).

Fixes #6960

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-16 14:20:39 -04:00
Daniel J Walsh fb6d9a84c5
Bump github.com/containers/common from 0.15.2 to 0.16.0
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.15.2 to 0.16.0.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](https://github.com/containers/common/compare/v0.15.2...v0.16.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-16 13:11:10 -04:00
OpenShift Merge Robot f4766e01e3
Merge pull request #6988 from jwhonce/wip/connection
Fix `podman system connection` panic
2020-07-16 11:16:47 -04:00
OpenShift Merge Robot ad388b9b54
Merge pull request #7001 from containers/dependabot/go_modules/k8s.io/api-0.18.6
Bump k8s.io/api from 0.18.5 to 0.18.6
2020-07-16 11:13:43 -04:00
Daniel J Walsh a7d462825b
Bump k8s.io/api from 0.18.5 to 0.18.6
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.18.5 to 0.18.6.
- [Release notes](https://github.com/kubernetes/api/releases)
- [Commits](https://github.com/kubernetes/api/compare/v0.18.5...v0.18.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-16 10:00:53 -04:00
OpenShift Merge Robot 984fffcdbc
Merge pull request #6998 from containers/dependabot/go_modules/github.com/containers/conmon-2.0.19incompatible
Bump github.com/containers/conmon from 2.0.18+incompatible to 2.0.19+incompatible
2020-07-16 09:12:35 -04:00
OpenShift Merge Robot fbce0a9388
Merge pull request #6999 from containers/dependabot/go_modules/k8s.io/apimachinery-0.18.6
Bump k8s.io/apimachinery from 0.18.5 to 0.18.6
2020-07-16 09:09:23 -04:00
OpenShift Merge Robot 11fe85702c
Merge pull request #6997 from vrothberg/update-x/text
vendor golang.org/x/text@v0.3.3
2020-07-16 07:21:24 -04:00
dependabot-preview[bot] b655311e3a
Bump k8s.io/apimachinery from 0.18.5 to 0.18.6
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.18.5 to 0.18.6.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.18.5...v0.18.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-16 05:28:33 -04:00
dependabot-preview[bot] 66e8b10645
Bump github.com/containers/conmon
Bumps [github.com/containers/conmon](https://github.com/containers/conmon) from 2.0.18+incompatible to 2.0.19+incompatible.
- [Release notes](https://github.com/containers/conmon/releases)
- [Changelog](https://github.com/containers/conmon/blob/master/changelog.txt)
- [Commits](https://github.com/containers/conmon/compare/v2.0.18...v2.0.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-16 05:26:48 -04:00
Valentin Rothberg f688c161fb vendor golang.org/x/text@v0.3.3
Fixes: CVE-2020-14040
Fixes: bugzilla.redhat.com/show_bug.cgi?id=1854718
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-16 10:59:49 +02:00
Jhon Honce 74ca2716a8 Fix podman system connection panic
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-07-15 14:20:54 -07:00
OpenShift Merge Robot 9efeb1cf29
Merge pull request #6903 from ashley-cui/problemlang
Fix & add notes regarding problematic language in codebase
2020-07-15 17:18:26 -04:00
OpenShift Merge Robot 6dcff5c32b
Merge pull request #6975 from baude/rootlessIPMAC
Error on rootless mac and ip addresses
2020-07-15 16:38:36 -04:00
OpenShift Merge Robot 9051546c4d
Merge pull request #6979 from edsantiago/bats_masked_dirs
system tests: check for masked-device leaks
2020-07-15 14:08:16 -04:00
OpenShift Merge Robot 38f73db9de
Merge pull request #6977 from mheon/fix_6953
Preserve passwd on container restart
2020-07-15 14:03:14 -04:00
OpenShift Merge Robot 8704b78a6f
Merge pull request #6958 from edsantiago/bats
system tests: new tests for run, exec
2020-07-15 10:27:09 -04:00
Matthew Heon 1ad7042a34 Preserve passwd on container restart
We added code to create a `/etc/passwd` file that we bind-mount
into the container in some cases (most notably,
`--userns=keep-id` containers). This, unfortunately, was not
persistent, so user-added users would be dropped on container
restart. Changing where we store the file should fix this.

Further, we want to ensure that lookups of users in the container
use the right /etc/passwd if we replaced it. There was already
logic to do this, but it only worked for user-added mounts; it's
easy enough to alter it to use our mounts as well.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-15 10:25:46 -04:00
Ashley Cui d419856009 Fix & add notes regarding problematic language in codebase
Podman is committed to inclusivity, a core value of open source. Historically, there have been technology terms that are problematic and divisive, and should be changed. We are currently taking time to audit our repository in order to eliminate such terminology, and replace it with more inclusive terms. We are starting where we can, with our own code, comments, and documentation. However, such terms may be used in dependencies, and must be used in our repositories at the current moment for compatibility. Podman will change these terms in our repo as soon as new and better terminology is available to us via our dependencies.

For more information: https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language?sc_cid=701600000011gf0AAA

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-15 09:13:15 -04:00
Brent Baude c58127602e Error on rootless mac and ip addresses
When creating a pod or container where a static MAC or IP address is provided, we should return a proper error and exit as 125.

Fixes: #6972

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-07-15 07:06:58 -05:00
OpenShift Merge Robot 60127cf5e8
Merge pull request #6949 from AkihiroSuda/fix-6948
Fix "Error: unrecognized protocol \"TCP\" in port mapping"
2020-07-15 06:17:09 -04:00
OpenShift Merge Robot 76f9f96af9
Merge pull request #6974 from sshnaidm/fixdocs1
docs: user namespace can't be shared in pods
2020-07-15 06:05:41 -04:00
OpenShift Merge Robot 4138cc9167
Merge pull request #6978 from edsantiago/apiv2_flake_fix
APIv2 tests: fix race condition causing CI flake
2020-07-15 06:03:03 -04:00
OpenShift Merge Robot 4250d24299
Merge pull request #6971 from TristanCacqueray/master
play-kube: add suport for "IfNotPresent" pull type
2020-07-15 04:53:19 -04:00
OpenShift Merge Robot 6224f3f5d5
Merge pull request #6956 from mheon/add_ports_to_pod_inspect
Include infra container information in `pod inspect`
2020-07-15 04:50:40 -04:00
aleks-mariusz 8d12f19371
allow switching of port-forward approaches in rootless/using slirp4netns
As of podman 1.8.0, because of commit da7595a, the default approach of providing
port-forwarding in rootless mode has switched (and been hard-coded) to rootlessport,
for the purpose of providing super performance. The side-effect of this switch is
source within the container to the port-forwarded service always appears to originate
from 127.0.0.1 (see issue #5138).

This commit allows a user to specify if they want to revert to the previous approach
of leveraging slirp4netns add_hostfwd() api which, although not as stellar performance,
restores usefulness of seeing incoming traffic origin IP addresses.

The change should be transparent; when not specified, rootlessport will continue to be
used, however if specifying --net slirp4netns:slirplisten the old approach will be used.

Note: the above may imply the restored port-forwarding via slirp4netns is not as
performant as the new rootlessport approach, however the figures shared in the original
commit that introduced rootlessport are as follows:
slirp4netns: 8.3 Gbps,
RootlessKit: 27.3 Gbps,
which are more than sufficient for many use cases where the origin of traffic is more
important than limits that cannot be reached due to bottlenecks elsewhere.

Signed-off-by: Aleks Mariusz <m.k@alek.cx>
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-07-15 08:04:35 +02:00
Akihiro Suda 758a700c11
Fix "Error: unrecognized protocol \"TCP\" in port mapping"
"TCP" in upper characters was not recognized as a valid protocol name.

Fix #6948

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-07-15 14:30:32 +09:00
Ed Santiago d3f9f09892 APIv2 tests: fix race condition causing CI flake
A newly-added test in #6835 was flaking in CI with:

   not ok 143 [20-containers] DELETE libpod/containers/SHA
   500 cannot remove container <sha> as it is running - running or paused containers cannot be removed without force: container state improper

Root cause: DELETE being run immediately after container start.
Although the container is short-lived, it does take time to
run and exit.

Solution: wait for container to exit (should be quick) before
deleting. This gives us a new test for the /wait endpoint.

Also: tweaked some comments for readability, removed unnecessary
container ps, added actual container status checks, and added
actual message checks to another test that was merely checking
exit status.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-07-14 16:09:58 -06:00
Ed Santiago 65644d8aa4 system tests: check for masked-device leaks
PR #6957 added a new path (/sys/devs) to an existing list
of masked mount points which an unprivileged container
should not be able to access. Here we add a test for
those: run 'stat' on those devices in the container,
and make sure that they are dummies.

This is kind of kludgy, and relies on heuristics that
may not be 100% accurate. It also adds duplication,
a list that must be kept in sync with the original
list in pkg/specgen/generate/config_linux.go.
I'd love to hear suggestions on how to do it better.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-07-14 16:02:51 -06:00
OpenShift Merge Robot c4843d4e9c
Merge pull request #6957 from rhatdan/sysdev
Mask out /sys/dev to prevent information leak from the host
2020-07-14 22:49:48 +02:00