Commit graph

8431 commits

Author SHA1 Message Date
Paul Holzinger
2e35dfa20c 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-22 13:49:58 -04:00
Ashley Cui
7461bafabb Fix Generate API title/description
generate kube title and descritopn was same as play kube for apiv2 docs

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-22 13:45:33 -04:00
Daniel J Walsh
a5f5e45c4b Add noop function disable-content-trust
People who use docker scripts with Podman see failures
if they use disable-content-trust flag.  This flag already
existed for podman build, adding it to pull/push/create/run.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-22 13:42:56 -04:00
zhangguanzhang
092ff38129 fix play kube doesn't override dockerfile ENTRYPOINT
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-07-22 13:29:59 -04:00
Daniel J Walsh
cb603b8a3e Support default profile for apparmor
Currently you can not apply an ApparmorProfile if you specify
--privileged.  This patch will allow both to be specified
simultaniosly.

By default Apparmor should be disabled if the user
specifies --privileged, but if the user specifies --security apparmor:PROFILE,
with --privileged, we should do both.

Added e2e run_apparmor_test.go

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-22 13:14:15 -04:00
OpenShift Merge Robot
2d24487ba2
Merge pull request #7049 from mheon/update_c_common
Bump github.com/containers/common to v0.14.6
2020-07-22 18:54:27 +02:00
Matthew Heon
9e7c7211c4 Bump github.com/containers/common to v0.14.6
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-22 10:48:13 -04:00
OpenShift Merge Robot
ff31cdc558
Merge pull request #7038 from vrothberg/2.0-events-endpoint
[2.0] events fixes
2020-07-22 03:39:36 -04:00
OpenShift Merge Robot
0291928abb
Merge pull request #7033 from rhatdan/v2.0
[2.0] Switch references from libpod.conf to containers.conf
2020-07-21 13:43:54 -04:00
Valentin Rothberg
3fcdd0d54e events endpoint: backwards compat to old type
The versions Docker that the compat endpoints currently support are
using another type for the `filters` parameter than later versions
of Docker, which the libpod/events endpoint is also using.

To prevent existing deplopyments from breaking while still achieving
backward compat, we now support both types for the filters parameter.

Tested manually.

Fixes: #6899
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-21 16:56:46 +02:00
Valentin Rothberg
142db01942 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-21 16:56:26 +02:00
OpenShift Merge Robot
1b8d0e4543
Merge pull request #7029 from vrothberg/2.0-systemd-cleanups
[2.0] contrib/systemd cleanups
2020-07-21 09:52:49 -04:00
Daniel J Walsh
330e9144bd
Switch references from libpod.conf to containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-21 09:29:01 -04:00
Valentin Rothberg
87ccd28d06 podman.service: set type to simple
Set the type of the podman.service to simple.  This will correctly
report the status of the service once it has started.  As a oneshot
service, it does not transition from the startup state to running.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-21 09:03:52 +02:00
Valentin Rothberg
a334e780b5 podman.service: set doc to podman-system-service
podman-api(1) does not exist, so set the man page to
podman-system-service(1).  Same for the .socket.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-21 09:03:47 +02:00
Valentin Rothberg
a7ffdf954f podman.service: use default registries.conf
Do not hard-set the registries.conf to `/etc/containers/registries.conf`.
Podman (and other c/image users) already default to it.  However,
ordinary non-root users should still be able to use the configs in their
home directories which is now possible.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-21 09:03:41 +02:00
Valentin Rothberg
1123738868 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-21 09:03:36 +02:00
Valentin Rothberg
1624fbb943 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-21 09:03:32 +02:00
Valentin Rothberg
48cb5f048e 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-21 09:03:29 +02:00
OpenShift Merge Robot
a5a5ad184e
Merge pull request #6996 from vrothberg/2.0-update-x/text
[2.0] vendor golang.org/x/text@v0.3.3
2020-07-16 07:21:20 -04:00
Valentin Rothberg
185d9effdb 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:43:47 +02:00
OpenShift Merge Robot
2a36096b50
Merge pull request #6910 from mheon/fix_out_of_range
Fix a bug where --pids-limit was parsed incorrectly
2020-07-15 12:55:46 -04:00
Matthew Heon
9810e586fe Fix a bug where --pids-limit was parsed incorrectly
The --pids-limit flag was using strconv.ParseInt with bad
arguments, resulting in it being unable to parse standard
integers (1024, for example, would produce an 'out of range'
error).

Change the arguments to make sense (base 10, max 32-bit) and
add a test to ensure we don't regress again.

Fixes #6908

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-07-15 10:04:42 -04:00
OpenShift Merge Robot
5262c53598
Merge pull request #6921 from vrothberg/2.0-wildcard-search
[2.0] search: allow wildcards
2020-07-15 07:53:28 -04:00
Valentin Rothberg
660208cea3 search: allow wildcards
Allow wildcards in the search term.  Note that not all registries
support wildcards and it may only work with v1 registries.

Note that searching implies figuring out if the specified search term
includes a registry.  If there's not registry detected, the search term
will be used against all configured "unqualified-serach-registries" in
the registries.conf.  The parsing logic considers a registry to be the
substring before the first slash `/`.

With these changes we now not only support wildcards but arbitrary
input; ultimately it's up to the registries to decide whether they
support given input or not.

Fixes: bugzilla.redhat.com/show_bug.cgi?id=1846629
Cherry-pick-of: commit b05888a97d
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-15 11:42:04 +02:00
Brent Baude
7f8643a782 [CI:DOCS]Do not copy policy.json into gating image
test/policy.json should not need to be copied into the gating image

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-07-15 11:42:04 +02:00
Brent Baude
2c72fbdd82 Fix systemd pid 1 test
fedora removed the systemd package from its standard container image causing our systemd pid1 test to fail.  Replacing usage of fedora to ubi-init.

adding ubi images to the cache for local tests.

also, remove installation of test/policy.json to the system wide /etc/containers

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-07-15 11:42:04 +02:00
Chris Evich
79167a157f Cirrus: Rotate keys post repo. rename
Encode credentials at new repository settings page
https://cirrus-ci.com/settings/repository/6707778565701632

Ref: https://cirrus-ci.org/guide/writing-tasks/#encrypted-variables

Backport-of: commit 576ce0f1b5
Signed-off-by: Chris Evich <cevich@redhat.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-15 11:42:04 +02:00
OpenShift Merge Robot
373ba8c017
Merge pull request #6888 from mheon/bump_202
[CI:DOCS] Bump to v2.0.2
2020-07-07 20:48:17 +02:00
Matthew Heon
0f338dd991 Bump to v2.0.3-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-07-07 14:26:27 -04:00
Matthew Heon
201c9505b8
Bump to v2.0.2
Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-07-07 14:25:29 -04:00
OpenShift Merge Robot
c3c03f9ca1
Merge pull request #6883 from vrothberg/2.0-events-race
[2.0] fix race condition in `libpod.GetEvents(...)`
2020-07-07 20:21:13 +02:00
OpenShift Merge Robot
442220e7a8
Merge pull request #6886 from mheon/final_202_relnotes
[CI:DOCS] Finalize release notes for Podman v2.0.2
2020-07-07 19:49:39 +02:00
Matthew Heon
2c8f73b4dd Finalize release notes for Podman v2.0.2
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-07 13:16:30 -04:00
Valentin Rothberg
0bc40bdcf3 fix race condition in libpod.GetEvents(...)
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.

Backport-of: commit f4a2d25c0f
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-07 17:29:14 +02:00
OpenShift Merge Robot
ea7a6101ef
Merge pull request #6873 from baude/v2.0disableconnection
remove podman system connection
2020-07-07 06:03:08 -04:00
OpenShift Merge Robot
6dae4bae2e
Merge pull request #6874 from mheon/backport_mount_fix
Backport 'podman mount' bugfix
2020-07-06 19:51:21 -04:00
Matthew Heon
8ab0abbb06 Fix bug where podman mount didn't error as rootless
We require that rootless `podman mount` be run inside a shell
spawned by `podman unshare` (which gives us a mount namespace
which actually lets other commands use the mounted filesystem).

The fix is simple - we need to mark the command as requiring the
rootless user namespace not be configured, so we can test for it
later as part of the mount code and error if we needed to make
one.

Disable rootless tests as part of this - they were never expected
to work.

Fixes #6856

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-06 16:59:05 -04:00
Brent Baude
66e1626282 remove podman system connection
podman system connection was panic'ing and not working as expected.  we are temporarily removing to as to not confuse users until we can fix it and prevent regressions with integrations tests.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-07-06 15:36:17 -05:00
OpenShift Merge Robot
e3e2b1e659
Merge pull request #6871 from mheon/202_backports
Backports for v2.0.2
2020-07-06 15:55:15 -04:00
OpenShift Merge Robot
b8ad7f241a
Merge pull request #6870 from rhatdan/v2.0
Pids-limit should only be set if the user set it
2020-07-06 15:52:25 -04:00
Matthew Heon
2fb9bb20df Fix imports to ensure v2 is used with libpod
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-06 14:44:40 -04:00
Matthew Heon
a67526d9f2 Update release notes for v2.0.2
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-06 14:25:39 -04:00
Ralf Haferkamp
626aeffc55 specgen: fix order for setting rlimits
Also make sure that the limits we set for rootless are not higher than
what we'd set for root containers.

Rootless containers failed to start when the calling user already
had ulimit (e.g. on NOFILE) set.

This is basically a cherry-pick of 76f8efc0d0 into specgen

Signed-off-by: Ralf Haferkamp <rhafer@suse.com>
2020-07-06 14:21:53 -04:00
Matthew Heon
0b7885b90a Ensure umask is set appropriately for 'system service'
We need a umask of 0022 to ensure containers are created
correctly, but we set a different one prior to starting the
server (to ensure the unix socket has the right permissions).
Thus, we need to set the umask after the socket has been bound,
but before the server begins accepting requests.

Fixes #6787

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-07-06 14:21:17 -04:00
Valentin Rothberg
8643526953 generate systemd: improve pod-flags filter
When generating systemd unit for pods, we need to remove certain
pod-related flags from the containers' create commands.  Make sure
to account for all the syntax including a single argument with key and
value being split by `=`.

Fixes: #6766
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-06 14:18:20 -04:00
Maximilian Müller
1444be3d53 Fix a bug with APIv2 compat network remove to log an ErrNetworkNotFound instead of nil
Signed-off-by: Maximilian Müller <maxm123@techie.com>
2020-07-06 14:16:39 -04:00
Jhon Honce
8dd26289bf Fixes --remote flag issues
* --remote, --url and --identity are now anchored to podman command.
  Subcommands should no longer have issues
* TraverseChildren now set to V1 expectations
* Latest flag now has helper function. Now has consistent usage.
* IsRemote() uses cobra parser to determin if --remote is given
* Moved validation functions from parser pkg to validate pkg
*

Fixes #6598
Fixes #6704

Signed-off-by: Jhon Honce <jhonce@redhat.com>

<MH: Fixed import issues>

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2020-07-06 14:14:53 -04:00
Daniel J Walsh
c4023a9302
Pids-limit should only be set if the user set it
Currently we are sending over pids-limits from the user even if they
never modified the defaults.  The pids limit should be set at the server
side unless modified by the user.

This issue has led to failures on systems that were running with cgroups V1.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-06 14:14:48 -04:00
Brent Baude
de6a8609a8 Set console mode for windows
Windows terminal handling is different than darwin and linux.  It needs to have the terminal mode set to enable virtual terminal processing.  This allows colors and other things to work.

Signed-off-by: Brent Baude <bbaude@redhat.com>

<MH: Tweaked imports to compile>

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2020-07-06 13:41:39 -04:00