Commit graph

1451 commits

Author SHA1 Message Date
baude 72ec8b0aa2 migrate play kube to spec gen
we need to migrate play kube away from using the old container creation
method.  the new approach is specgen and this aligns play kube with
container creation in the rest of podman.

Signed-off-by: baude <bbaude@redhat.com>
2020-11-10 07:55:24 -06:00
OpenShift Merge Robot da95fb4226
Merge pull request #8270 from andylibrian/log-driver-option-for-play-kube
Add --log-driver to play kube
2020-11-10 12:29:19 +00:00
baude ddadc99e99 make network name uniq for dnsname tests
ed identified that the dnsname integration test does not use a unique
name and therefore cannot be cleaned up.  this was made worse by a
improper defer statement to remove the network should the test fail.

Signed-off-by: baude <bbaude@redhat.com>
2020-11-09 16:35:12 -06:00
Paul Holzinger f14cb5ef61 Add support for podman search --format json
Fixes #8274

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-09 12:59:59 +01:00
Andy Librian f3355d9697
Add --log-driver to play kube
addresses #6604

Signed-off-by: Andy Librian <andylibrian@gmail.com>
2020-11-08 08:59:18 +07:00
OpenShift Merge Robot 3ef721fa1f
Merge pull request #8238 from joelsmith/master
Use regex for "pod ps" name filter to match "ps" behavior
2020-11-05 01:54:22 +01:00
Chris Evich f37d1d2175
Use ping from alpine
As of this commit, in Fedora 33, without without `CAP_NET_ADMIN` and
`CAP_NET_RAW`, require setting `net.ipv3.ping_group_range` in order for
the `ping` command to work inside a container.  However, not all images
`ping` are created equal.  For whatever reason, the busybox version in
the busybox container image, does not function.  Switch to the Alpine
image's busybox ping, which seems to work fine.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-11-04 09:37:35 -05:00
OpenShift Merge Robot 7699557b5d
Merge pull request #8225 from debarshiray/wip/rishi/exec_test-use-containsubstring
Improve error messages from failing tests
2020-11-04 06:18:08 -05:00
Joel Smith a47fe37a97 Use regex for "pod ps" name filter to match "ps" behavior
Signed-off-by: Joel Smith <joelsmith@redhat.com>
2020-11-03 15:31:39 -07:00
OpenShift Merge Robot 5f897d2abe
Merge pull request #8232 from ashley-cui/volfilt
Make volume filters inclusive
2020-11-03 16:25:39 -05:00
Ashley Cui 532bce4ad4 Make volume filters inclusive
When using multiple filters, return a volume that matches any one of the used filters, rather than matching both of the filters.
This is for compatibility with docker's cli, and more importantly, the apiv2 compat endpoint
Closes #6765

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-11-03 14:35:01 -05:00
Debarshi Ray 2b859a9d18 Improve error messages from failing tests
Using a function like ContainSubstring or Equal is better because if
the test fails it will log a descriptive error that includes the
actual string generated during the test. This is more helpful than a
function like BeTrue that will only indicate that an assertion failed
without giving further details of the failure.

Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2020-11-03 19:36:44 +01:00
OpenShift Merge Robot 110c1c8b4b
Merge pull request #8231 from baude/fedorarootlesscpulimit
fedora rootless cpu settings
2020-11-03 12:21:08 -05:00
OpenShift Merge Robot 2a6e96e7ae
Merge pull request #8226 from debarshiray/wip/rishi/toolbox_test-userns-keepid-HOME
Test $HOME when it's parent is bind mounted with --userns=keep-id
2020-11-03 12:04:26 -05:00
baude 73742a0e73 fedora rootless cpu settings
fedora does not have the the ability in rootless to set cpu limits.
this requires a simple fix for fedora 33 to pass ci tests.

Signed-off-by: baude <bbaude@redhat.com>
2020-11-03 09:28:06 -06:00
Debarshi Ray b00a195ba2 Test $HOME when it's parent is bind mounted with --userns=keep-id
When --userns=keep-id is used, Podman is supposed to set up the home
directory of the user inside the container to match that on the host
as long as the home directory or any of its parents are marked as
volumes to be bind mounted into the container.

Currently, the test only considers the case where the home directory
itself is bind mounted into the container. It doesn't cover the Podman
code that walks through all the bind mounts looking for ancestors in
case the home directory itself wasn't specified as a bind mount.

Therefore, this improves the existing test added in commit
6ca8067956 ("Setup HOME environment when using --userns=keep-id")

Note that this test can't be run as root. The home directory of the
root user is /root, and it's parent is /. Bind mounting the entire /
from the host into the container prevents it from starting:
  Error: openat2 ``: No such file or directory: OCI not found

Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2020-11-03 01:56:16 +01:00
Giuseppe Scrivano afa4ec0db0
specgen: keep capabilities with --userns=keep-id
if --userns=keep-id is specified and not --user is specified, take the
unprivileged capabilities code path so that ambient capabilities are
honored in the container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-02 15:46:56 +01:00
Giuseppe Scrivano 6a94429098
specgen: fix check for root user
if the username is specified in the USER:GROUP form, make sure we only
check for USER.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-02 14:39:02 +01:00
Giuseppe Scrivano bce8f851c1
specgen: add support for ambient capabilities
if the kernel supports ambient capabilities (Linux 4.3+), also set
them when running with euid != 0.

This is different that what Moby does, as ambient capabilities are
never set.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-11-02 14:36:39 +01:00
OpenShift Merge Robot 5a53c6e5c9
Merge pull request #8203 from Luap99/fix-8194
Fix dnsname when joining a different network namespace in a pod
2020-10-31 11:12:05 +01:00
OpenShift Merge Robot b6ab2df9d1
Merge pull request #8100 from QiWang19/mirror-manifest
manifest list inspect single image
2020-10-31 00:19:52 +01:00
OpenShift Merge Robot e5227b9d75
Merge pull request #8201 from QiWang19/search-limit
Remove search limit since pagination support
2020-10-30 20:34:28 +01:00
Paul Holzinger 2704dfbb7a Fix dnsname when joining a different network namespace in a pod
When creating a container in a pod the podname was always set as
the dns entry. This is incorrect when the container is not part
of the pods network namespace. This happend both rootful and
rootless. To fix this check if we are part of the pods network
namespace and if not use the container name as dns entry.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-10-30 18:53:55 +01:00
Qi Wang 57650aa5f3 manifest list inspect single image
If the image name not a manifest list type, enable manifest inspect to return manifest of single image manifest type vnd.docker.distribution.manifest.v2+json.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-30 11:13:57 -04:00
Qi Wang cab33cfbf6 Remove search limit since pagination support
Remove the search limit check since the c/image v5.6.0 supports pagination and can give result over 100 entries.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-30 11:00:40 -04:00
Daniel J Walsh 916825b675
Pod's that share the IPC Namespace need to share /dev/shm
Containers that share IPC Namespaces share each others
/dev/shm, which means a private /dev/shm needs to be setup
for the infra container.

Added a system test and an e2e test to make sure the
/dev/shm is shared.

Fixes: https://github.com/containers/podman/issues/8181

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-30 05:21:34 -04:00
OpenShift Merge Robot 6d72e7611e
Merge pull request #8165 from edsantiago/move_from_dockerio
Move from docker.io
2020-10-29 18:00:33 +01:00
OpenShift Merge Robot 464aa36b0c
Merge pull request #8081 from mheon/pod_degraded
Add a Degraded state to pods
2020-10-28 16:10:33 -04:00
Ed Santiago 20e104351d move from docker.io
Followon to #7965 (mirror registry). mirror.gcr.io doesn't
cache all the images we need, and I can't find a way to
add to its cache, so let's just use quay.io for those
images that it can't serve.

Tools used:
  skopeo copy --all docker://docker.io/library/alpine:3.10.2 \
                    docker://quay.io/libpod/alpine:3.10.2

...and also:

    docker.io/library/alpine:3.2
    docker.io/library/busybox:latest
    docker.io/library/busybox:glibc
    docker.io/library/busybox:1.30.1
    docker.io/library/redis:alpine
    docker.io/libpod/alpine-with-bogus-seccomp:label
    docker.io/libpod/alpine-with-seccomp:label
    docker.io/libpod/alpine_healthcheck:latest
    docker.io/libpod/badhealthcheck:latest

Since most of those were new quay.io/libpod images, they required
going in through the quay.io GUI, image, settings, Make Public.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-28 13:16:37 -06:00
OpenShift Merge Robot 7149a7cb39
Merge pull request #8102 from ashley-cui/inspect
Add pod, volume, network to inspect package
2020-10-27 17:04:44 -04:00
Ashley Cui 61deec451f Add pod, volume, network to inspect package
podman inspect only had the capabilities to inspect containers and images. if a user wanted to inspect a pod, volume, or network, they would have to use `podman network inspect`, `podman pod inspect` etc. Docker's cli allowed users to inspect both volumes and networks using regular inspect, so this commit gives the user the functionality

If the inspect type is not specified using --type, the order of inspection is:

containers
images
volumes
networks
pods

meaning if container that has the same name as an image, podman inspect would return the container inspect.

To avoid duplicate code, podman network inspect and podman volume inspect now use the inspect package as well. Podman pod inspect does not because podman pod inspect returns a single json object while podman inspect can return multiple)

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-10-27 14:42:54 -04:00
Daniel J Walsh 2099c86f33
build(deps): bump github.com/containers/common from 0.26.0 to 0.26.3
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.26.0 to 0.26.3.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](containers/common@v0.26.0...v0.26.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-27 07:25:23 -04:00
Matej Vasek 97d47ef3d5 fix: podman-cp respects "--extract" flag
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2020-10-25 15:58:36 +01:00
OpenShift Merge Robot 8e06f8efbc
Merge pull request #8053 from rhatdan/detachkeys
podman create doesn't support creating detached containers
2020-10-22 16:29:28 -04:00
OpenShift Merge Robot 2ca4af6c40
Merge pull request #8110 from lsm5/cap-net-raw
replace net_raw with setuid
2020-10-22 16:22:38 -04:00
Lokesh Mandvekar 914bbf5e49 replace net_raw with setuid
podman does not allow setting CAP_NET_RAW

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-10-22 12:18:04 -04:00
OpenShift Merge Robot d340f8523c
Merge pull request #8101 from mheon/net_none_hostname
Add hostname to /etc/hosts for --net=none
2020-10-22 11:25:27 -04:00
OpenShift Merge Robot 513c2610f3
Merge pull request #7956 from QiWang19/save-rm-sig
Allow save image remove-signatures
2020-10-22 11:00:09 -04:00
Daniel J Walsh 15345ce4c3
podman create doesn't support creating detached containers
Detached containers and detach keys are only created with the podman run, i
exec, and start commands.  We do not store the detach key sequence or the
detach flags in the database, nor does Docker. The current code was ignoreing
these fields but documenting that they can be used.

Fix podman create man page and --help output to no longer indicate that
--detach and --detach-keys works.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 21:00:50 -04:00
Matthew Heon 0864d82cb5 Add hostname to /etc/hosts for --net=none
This does not match Docker, which does not add hostname in this
case, but it seems harmless enough.

Fixes #8095

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-21 13:45:41 -04:00
Matthew Heon cddfe3983b Add a Degraded state to pods
Make a distinction between pods that are completely running (all
containers running) and those that have some containers going,
but not all, by introducing an intermediate state between Stopped
and Running called Degraded. A Degraded pod has at least one, but
not all, containers running; a Running pod has all containers
running.

First step to a solution for #7213.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-21 13:31:40 -04:00
OpenShift Merge Robot 9060af9719
Merge pull request #8093 from rhatdan/wait
Fix handling and documentation of podman wait --interval
2020-10-21 11:30:44 -04:00
Qi Wang b898f914a3 save image remove signatures
remove signatures to podman save since the image formats do not support signatures
Close: #7659

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-21 10:00:08 -04:00
OpenShift Merge Robot b4a10538e1
Merge pull request #7948 from saschagrunert/ps-fix
Fix ps port output
2020-10-21 08:42:41 -04:00
OpenShift Merge Robot 9d9c58ba64
Merge pull request #8065 from edsantiago/flake_tweaks
Tests: Fix common flakes, and improve apiv2 test log
2020-10-21 07:21:49 -04:00
Daniel J Walsh 3f265e91f4
Fix handling and documentation of podman wait --interval
In older versions of podman, we supported decimal numbers defaulting
to microseconds.  This PR fixes to allow users to continue to specify
only digits.

Also cleaned up documentation to fully describe what input for --interval flag.

Finally improved testing on podman wait to actually make sure the command succeeded.
Fixed tests to work on podman-remote.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 06:25:36 -04:00
OpenShift Merge Robot 94873a237a
Merge pull request #8075 from mheon/fix_8073
Retrieve network inspect info from dependency container
2020-10-20 17:07:11 -04:00
OpenShift Merge Robot 4822cc8cab
Merge pull request #8042 from rhatdan/tlsverify
--tls-verify and --authfile should work for all remote commands
2020-10-20 15:34:56 -04:00
OpenShift Merge Robot 6961b9475d
Merge pull request #8067 from mheon/net_host_hosts
Ensure that hostname is added to hosts with net=host
2020-10-20 15:18:53 -04:00
Ed Santiago f5b3dc976c Tests: Fix common flakes, and improve apiv2 test log
- apiv2 - the 'ten /info requests' test is flaking often,
  taking ~8 seconds (our limit is 7, up from 5 a few weeks
  ago). Brent suggested that the first /info call might be
  expensive, because it needs to access storage. So, let's
  prime it by running one /info outside the timing loop.
  And, because even that continues to fail, bump it up
  to 10 seconds and file #8076 to track the slowdown.

- toolbox test - WaitForReady() has timed out, even on one
  occasion causing a run failure because it failed 3 times.
  Solution: bump up timeout from 2s to 5s. Not really great,
  but CI systems are underpowered, and it's not unreasonable
  that 2s might be too low.

- sdnotify test - add a 'podman wait' between stop & rm.
  This may prevent a "cannot rm container as it is running"
  race condition.

While working on this, Brent and I noticed a few ways that
test-apiv2 logging can be improved:

- test name: when request is POST, display the jsonified
  parameters, not the original input ones. This should
  make it much easier to reproduce failures.

- use curl's "--write-out" option to capture http code,
  content type, and request time. We were getting the
  first two via grep from logged headers; this is cleaner.
  And there was no other way to get timing. We now include
  the timing as X-Response-Time in the log file.

- abort on *any* curl error, not just 7 (cannot connect).
  Any error at all from curl is bad news.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-20 11:32:49 -06:00