10478 Commits

Author SHA1 Message Date
63d8f535ec Merge pull request #8917 from mheon/actually_report_play_kube_errors
Ensure that `podman play kube` actually reports errors
2021-01-11 17:06:49 -05:00
20217f5789 Merge pull request #8932 from containers/dependabot/go_modules/github.com/containers/storage-1.24.5
Bump github.com/containers/storage from 1.24.4 to 1.24.5
2021-01-11 16:57:50 -05:00
d2503ae99b Merge pull request #8935 from giuseppe/conmon-keep-LC_
oci: keep LC_ env variables to conmon
2021-01-11 09:49:34 -05:00
7e3fb33be8 Ensure that podman play kube actually reports errors
In 2.2.x, we moved `play kube` to use the Start() API for pods,
which reported errors in a different way (all containers are
started in parallel, and then results reported as a block). The
migration attempted to preserve compatibility by returning only
one error, but that's not really a viable option as it can
obscure the real reason that a pod is failing. Further, the code
was not correctly handling the API's errors - Pod Start() will,
on any container error, return a map of container ID to error
populated for all container errors *and* return ErrPodPartialFail
for overall error - the existing code did not handle the partial
failure error and thus would never return container errors.

Refactor the `play kube` API to include a set of errors for
containers in each pod, so we can return all errors that occurred
to the frontend and print them for the user, and correct the
backend code so container errors are actually forwarded.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-01-11 09:30:35 -05:00
3b987a7e4e Merge pull request #8925 from rhatdan/build
podman build --force-rm defaults to true in code
2021-01-11 08:56:03 -05:00
63ecd1215a Bump github.com/containers/storage from 1.24.4 to 1.24.5
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.24.4 to 1.24.5.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.24.4...v1.24.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-11 08:50:59 -05:00
ae9dab9445 oci: keep LC_ env variables to conmon
it is necessary for conmon to deal with the correct locale, otherwise
it uses C as a fallback.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1893567
Requires: https://github.com/containers/conmon/pull/215

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-11 13:48:04 +01:00
41613bdb96 Merge pull request #8915 from rhatdan/remote
Improve error message when the the podman service is not enabled
2021-01-10 11:49:46 -05:00
3d453f9d2e podman build --force-rm defaults to true in code
The man page and code should match for what is the default settings.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-10 05:52:33 -05:00
bc0fa658f7 Merge pull request #8920 from Luap99/ps-network-filter
podman ps/pod ps add network filter and .Networks format placeholder
2021-01-10 05:31:11 -05:00
82bce7d906 Use abi PodPs implementation for libpod/pods/json endpoint
This removes unnecessary code duplication.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-09 23:38:26 +01:00
38baf3d5e2 Add Networks format placeholder to podman ps and pod ps
`podman ps --format {{.Networks}}` will show all connected networks for
this container. For `pod ps` it will show the infra container networks.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-09 19:15:43 +01:00
1242e7b7a6 Add network filter for podman ps and pod ps
Allow to filter on the network name or full id.
For pod ps it will filter on the infra container networks.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-09 17:03:32 +01:00
ea68f178e0 Improve error message when the the podman service is not enabled
Currently if server is not connected, we return an error message that
is confusing users on Mac and Windows boxes.  The hope here is to make
it a little easier to discover that a Podman service is required.

This message is similar to what Docker puts out so people might under
stand it better.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-09 04:19:39 -05:00
49db79e735 Merge pull request #8781 from rst0git/cr-volumes
Add support for checkpoint/restore of containers with volumes
2021-01-08 10:41:05 -05:00
a0b432d29d Merge pull request #8912 from jwhonce/issues/8891
Restore compatible API for prune endpoints
2021-01-08 06:56:15 -05:00
b059e1044f Restore compatible API for prune endpoints
* Restore correct API endpoint payloads including reclaimed space numbers
* Include tests for API prune endpoints
* Clean up function signatures with unused parameters
* Update swagger for /networks/prune

Fixes #8891

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-01-07 15:32:32 -07:00
78cda71372 Merge pull request #8907 from Luap99/fix-mips-build
Fix build for mips architecture follow-up
2021-01-07 15:12:35 -05:00
6c132b78f1 Merge pull request #8771 from rhatdan/run
Switch references of /var/run -> /run
2021-01-07 15:06:17 -05:00
3cf41c4a73 Merge pull request #8821 from rhatdan/caps
Containers should not get inheritable caps by default
2021-01-07 09:44:37 -05:00
74af9254b9 Merge pull request #8816 from giuseppe/automatically-split-userns-mappings
rootless: automatically split userns ranges
2021-01-07 09:35:01 -05:00
65c88ec473 Add mips architecture to the cross build target
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-07 15:04:40 +01:00
9dfc636fd6 Fix build for mips architecture follow-up
Follow-up to commit (1ad796677e1c). The build on mips is still
failing because SIGWINCH was not defined in the signal pkg.
Also stat_t.Rdev is unit32 on mips so we need to typecast.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-07 15:04:22 +01:00
a47515008b Merge pull request #8904 from Luap99/fix-podman-logs
Fix podman logs read partial log lines
2021-01-07 06:11:37 -05:00
db71759b1a Handle podman exec capabilities correctly
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-07 05:53:50 -05:00
9ebde6e03a Containers should not get inheritable caps by default
When I launch a container with --userns=keep-id the rootless processes
should have no caps by default even if I launch the container with
--privileged.  It should only get the caps if I specify by hand the
caps I want leaked to the process.

Currently we turn off capeff and capamb, but not capinh.  This patch
treats capinh the same way as capeff and capamb.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-07 05:53:07 -05:00
d9ebbbfe5b Switch references of /var/run -> /run
Systemd is now complaining or mentioning /var/run as a legacy directory.
It has been many years where /var/run is a symlink to /run on all
most distributions, make the change to the default.

Partial fix for https://github.com/containers/podman/issues/8369

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-07 05:37:24 -05:00
68c9e02df7 Merge pull request #8884 from containers/dependabot/go_modules/github.com/google/uuid-1.1.4
Bump github.com/google/uuid from 1.1.3 to 1.1.4
2021-01-07 05:34:08 -05:00
ecedda63a6 rootless: automatically split userns ranges
writing to the id map fails when an extent overlaps multiple mappings
in the parent user namespace:

$ cat /proc/self/uid_map
         0       1000          1
         1     100000      65536
$ unshare -U sleep 100 &
[1] 1029703
$ printf "0 0 100\n" | tee /proc/$!/uid_map
0 0 100
tee: /proc/1029703/uid_map: Operation not permitted

This limitation is particularly annoying when working with rootless
containers as each container runs in the rootless user namespace, so a
command like:

$ podman run --uidmap 0:0:2 --rm fedora echo hi
Error: writing file `/proc/664087/gid_map`: Operation not permitted: OCI permission denied

would fail since the specified mapping overlaps the first
mapping (where the user id is mapped to root) and the second extent
with the additional IDs available.

Detect such cases and automatically split the specified mapping with
the equivalent of:

$ podman run --uidmap 0:0:1 --uidmap 1:1:1 --rm fedora echo hi
hi

A fix has already been proposed for the kernel[1], but even if it
accepted it will take time until it is available in a released kernel,
so fix it also in pkg/rootless.

[1] https://lkml.kernel.org/lkml/20201203150252.1229077-1-gscrivan@redhat.com/

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-07 09:42:27 +01:00
09f4cc6fc3 rootless: add function to retrieve uid mappings
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-07 09:41:06 +01:00
fcc04fbaba rootless: add function to retrieve gid mappings
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-01-07 09:41:01 +01:00
1215bd9ffd test: Add checkpoint/restore with volumes
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2021-01-07 07:51:22 +00:00
288ccc4c84 Include named volumes in container migration
When migrating a container with associated volumes, the content of
these volumes should be made available on the destination machine.

This patch enables container checkpoint/restore with named volumes
by including the content of volumes in checkpoint file. On restore,
volumes associated with container are created and their content is
restored.

The --ignore-volumes option is introduced to disable this feature.

Example:

 # podman container checkpoint --export checkpoint.tar.gz <container>

The content of all volumes associated with the container are included
in `checkpoint.tar.gz`

 # podman container checkpoint --export checkpoint.tar.gz --ignore-volumes <container>

The content of volumes is not included in `checkpoint.tar.gz`. This is
useful, for example, when the checkpoint/restore is performed on the
same machine.

 # podman container restore --import checkpoint.tar.gz

The associated volumes will be created and their content will be
restored. Podman will exit with an error if volumes with the same
name already exist on the system or the content of volumes is not
included in checkpoint.tar.gz

 # podman container restore --ignore-volumes --import checkpoint.tar.gz

Volumes associated with container must already exist. Podman will not
create them or restore their content.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2021-01-07 07:51:19 +00:00
2b35876c8d Use Options as CRImportCheckpoint() argument
Instead of specifying restore option arguments individually from
RestoreOptions, provide the 'options' object to the CRImportCheckpoint
method. This change makes the code in CRImportCheckpoint easier to
extend as it doesn't require excessive number of function parameters.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2021-01-07 07:48:41 +00:00
17f50fb4bf Use Options as exportCheckpoint() argument
Instead of individual values from ContainerCheckpointOptions,
provide the options object.

This is a preparation for the next patch where one more value
of the options object is required in exportCheckpoint().

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2021-01-07 07:48:41 +00:00
355e387692 Merge pull request #8832 from hshiina/logfile
Fix e2e test for `podman build --logfile`
2021-01-06 20:19:34 -05:00
b7f699c199 Fix podman logs read partial log lines
If a partial log line has the length 1 it was ignored by podman logs.

Fixes #8879

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-07 00:04:38 +01:00
bb82c37b73 Merge pull request #8805 from giuseppe/single-user-mapped-root
libpod: handle single user mapped as root
2021-01-06 15:41:36 -05:00
8e4613ab0a Merge pull request #8892 from mheon/fix_8886
Ensure that user-specified HOSTNAME is honored
2021-01-06 15:26:55 -05:00
9198ed40e1 Merge pull request #8901 from mheon/reenable_cevich_tests
Revert e6fbc15f26b2a609936dfc11732037c70ee14cba and reenable tests
2021-01-06 15:20:09 -05:00
9494249f4b Merge pull request #8899 from cevich/new_2021_images
Cirrus: Update Fedora & Ubuntu images
2021-01-06 15:14:01 -05:00
fc44ac2ef2 Revert e6fbc15f26b2a609936dfc11732037c70ee14cba
The issue requiring these tests be disabled should be resolved.
Reenable the tests as such.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-01-06 11:48:06 -05:00
e467400eb1 Cirrus: Update Fedora & Ubuntu images
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-01-06 10:08:48 -05:00
8f844a66d5 Ensure that user-specified HOSTNAME is honored
When adding the HOSTNAME environment variable, only do so if it
is not already present in the spec. If it is already present, it
was likely added by the user, and we should honor their requested
value.

Fixes #8886

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-01-06 09:46:21 -05:00
ffe2b1e95a Merge pull request #8685 from mheon/ignore_containersconf_sysctls_shared_net
Ignore containers.conf sysctls when sharing namespaces
2021-01-05 17:08:31 -05:00
1f59276998 Merge pull request #8889 from vrothberg/run-1138
generate systemd: do not set `KillMode`
2021-01-05 14:16:47 -05:00
b84b7c89bb Merge pull request #8831 from bblenard/issue-8658-system-prune-reclaimed-space
Rework pruning to report reclaimed space
2021-01-05 11:35:18 -05:00
bc21fabbd7 Merge pull request #8885 from vrothberg/vendor-psgo
vendor containers/psgo@v1.5.2
2021-01-05 10:53:36 -05:00
219c69ef03 generate systemd: do not set KillMode
`KillMode=none` has been deprecated in systemd and is now throwing big
warnings when being used.  Users have reported the issues upstream
(see #8615) and on the mailing list.

This deprecation was mainly motivated by an abusive use of third-party
vendors causing all kinds of undesired side-effects.  For instance, busy
mounts that delay reboot.

After talking to the systemd team, we came up with the following plan:

 **Short term**: we can use TimeoutStopSec and remove KillMode=none which
 will default to cgroup.

 **Long term**: we want to change the type to sdnotify. The plumbing for
 Podman is done but we need it for conmon. Once sdnotify is working, we
 can get rid of the pidfile handling etc. and let Podman handle it.
 Michal Seklatar came up with a nice idea that Podman increase the time
 out on demand. That's a much cleaner way than hard-coding the time out
 in the unit as suggest in the short-term solution.

This change is executing the short-term plan and sets a minimum timeout
of 60 seconds.  User-specified timeouts are added to that.

Fixes: #8615
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-01-05 16:37:24 +01:00
bfbd915d62 Bump github.com/google/uuid from 1.1.3 to 1.1.4
Bumps [github.com/google/uuid](https://github.com/google/uuid) from 1.1.3 to 1.1.4.
- [Release notes](https://github.com/google/uuid/releases)
- [Commits](https://github.com/google/uuid/compare/v1.1.3...v1.1.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-01-05 10:10:46 -05:00