Commit graph

2139 commits

Author SHA1 Message Date
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
Jhon Honce df8bda8cc0 Add test/apiv2/rest_api tests to make target
* renamed old API tests to not be discovered, they do not pass
* Updated the API tests to use a pristine storage configuration
* Skipped attach test, it needs to be re-written

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-11-02 08:36:22 -07: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
OpenShift Merge Robot 1fe79dd677
Merge pull request #8177 from rhatdan/wrap
Stop excessive wrapping of errors
2020-10-30 19:52:17 +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
OpenShift Merge Robot e632f3f258
Merge pull request #8187 from jwhonce/wip/table
Restore --format table header support
2020-10-30 17:00:22 +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 831d7fb0d7
Stop excessive wrapping of errors
Most of the builtin golang functions like os.Stat and
os.Open report errors including the file system object
path. We should not wrap these errors and put the file path
in a second time, causing stuttering of errors when they
get presented to the user.

This patch tries to cleanup a bunch of these errors.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-30 05:34:04 -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 228396a99d
Merge pull request #8174 from rhatdan/errors
Podman often reports OCI Runtime does not exist, even if it does
2020-10-29 22:21:17 +01:00
OpenShift Merge Robot c8f0e1dab6
Merge pull request #8146 from vrothberg/image-mounts
new "image" mount type
2020-10-29 18:15:24 +01:00
Jhon Honce d60a0ddcc1 Restore --format table header support
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-29 10:14:08 -07: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
Valentin Rothberg 65a618886e new "image" mount type
Add a new "image" mount type to `--mount`.  The source of the mount is
the name or ID of an image.  The destination is the path inside the
container.  Image mounts further support an optional `rw,readwrite`
parameter which if set to "true" will yield the mount writable inside
the container.  Note that no changes are propagated to the image mount
on the host (which in any case is read only).

Mounts are overlay mounts.  To support read-only overlay mounts, vendor
a non-release version of Buildah.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-10-29 15:06:22 +01:00
Daniel J Walsh 0f191ad72c
Podman often reports OCI Runtime does not exist, even if it does
When the OCI Runtime tries to set certain settings in cgroups
it can get the error "no such file or directory",  the wrapper
ends up reporting a bogus error like:

```
 Request Failed(Internal Server Error): open io.max: No such file or directory: OCI runtime command not found error
{"cause":"OCI runtime command not found error","message":"open io.max: No such file or directory: OCI runtime command not found error","response":500}
```

On first reading of this, you would think the OCI Runtime (crun or runc) were not found.  But the error is actually reporting

message":"open io.max: No such file or directory

Which is what we want the user to concentrate on.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-29 06:19:21 -04: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
Chris Evich 53fe386da0 Cirrus: Use google mirror for docker.io
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-28 12:25:53 -06:00
OpenShift Merge Robot 4d87306fbe
Merge pull request #8157 from rhatdan/volumes
Add test cases to cover podman volume
2020-10-28 08:55:16 -04: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
OpenShift Merge Robot eda5a6d069
Merge pull request #8145 from containers/dependabot/go_modules/github.com/containers/common-0.26.2
Bump github.com/containers/common from 0.26.0 to 0.26.3
2020-10-27 13:20:07 -04:00
Yuhui Jiang b8641aec36
Add test cases to cover podman volume
Add test cases to cover below podman volume subcommand:
  create
  ls
  inspect
  rm
  prune

Signed-off-by: Yuhui Jiang <yujiang@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-27 13:16:04 -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
Ed Santiago c93d4be41e System tests: cleanup, make more robust
- run test: preserve --runtime test: use a random executable
  path. And, clean up better.

- run test: "look up correct image name" test: use random
  strings; test both without and with a :tag

- events test: use random label strings, add more filter tests

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-26 13:29:15 -06: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 bce8331528
Merge pull request #8096 from ypu/log-driver-test
Tests: Check different log driver can work with podman logs
2020-10-25 10:46:44 -04:00
baude c593e49701 filter events by labels
adding the ability to filter evens by the container labels.  this requires that container labels be added to the events data being recorded and subsequently read.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-23 12:07:34 -05: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 2cb12bbc5a
Merge pull request #8098 from vrothberg/fix-8082
container create: record correct image name
2020-10-22 11:03:46 -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
Yiqiao Pu 8e66795530 Tests: Check different log driver can work with podman logs
Add a check step in podman run --log-driver test. Prefer to add
it here as it already has a loop to cover all different drivers
in this test.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2020-10-22 14:38:28 +08: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 a1b942ff40
Merge pull request #8034 from rhatdan/options
Switch help messages from using [flags] to [options]
2020-10-21 12:59:42 -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
Valentin Rothberg 410fa53f89 container create: record correct image name
Record the correct image name when creating a container by using the
resolved image name if present.  Otherwise, default to using the first
available name or an empty string in which case the image must have been
referenced by ID.

Fixes: #8082
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-10-21 16:51:09 +02: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
Daniel J Walsh 980b1e87d4
Switch use of Flags to Options
Want to have man pages match commands, since we have lots of printed
man pages with using Options, we will change the command line to use
Options in --help.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 08:37:57 -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
OpenShift Merge Robot d5073af6b2
Merge pull request #8022 from baude/compatapitospecgen
refactor api compatibility container creation to specgen
2020-10-21 06:35:51 -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
Matthew Heon c1b844ecc8 Retrieve network inspect info from dependency container
When a container either joins a pod that shares the network
namespace or uses `--net=container:` to share the network
namespace of another container, it does not have its own copy of
the CNI results used to generate `podman inspect` output. As
such, to inspect these containers, we should be going to the
container we share the namespace with for network info.

Fixes #8073

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-10-20 13:27:33 -04:00
baude eb91d66c4a refactor api compatibility container creation to specgen
when using the compatibility layer to create containers, it used code paths to the pkg/spec which is the old implementation of containers.  it is error prone and no longer being maintained.  rather that fixing things in spec, migrating to specgen usage seems to make the most sense.  furthermore, any fixes to the compat create will not need to be ported later.

Signed-off-by: baude <bbaude@redhat.com>
2020-10-20 12:06:59 -05:00
Sascha Grunert f63bbca4da
Fix ps port output
When defining multiple ports (same src/dst) like `-p 80:80 -p 443:443`
then podman will not show the complete output on `podman ps` (only
`0.0.0.0:80->80/tcp` in the example). This also applies to port ranges.

This patch refactors the port loop by pre-checking for ranges and
displaying them correctly to the end user.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-10-20 17:00:23 +02:00
Matthew Heon 1b288a35ba Ensure that hostname is added to hosts with net=host
When a container uses --net=host the default hostname is set to
the host's hostname. However, we were not creating any entries
in `/etc/hosts` despite having a hostname, which is incorrect.
This hostname, for Docker compat, will always be the hostname of
the host system, not the container, and will be assigned to IP
127.0.1.1 (not the standard localhost address).

Also, when `--hostname` and `--net=host` are both passed, still
use the hostname from `--hostname`, not the host's hostname (we
still use the host's hostname by default in this case if the
`--hostname` flag is not passed).

Fixes #8054

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-20 10:31:15 -04:00
Matthew Heon 1b4933376f Add a system test to verify --runtime is preserved
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-20 09:24:32 -04:00
Matthew Heon 3858fc1d01 Use runtime names instead of paths in E2E tests
My patches to fix `--runtime /usr/bin/crun` being allowed to use
a different version of the crun runtime revealed a problem: we
were actually relying on that exact behavior in our E2E tests. We
specified the runtime path as `/usr/bin/runc` for the Ubuntu
tests, but that didn't exist, so Podman was actively looking for
a different, usable runc binary and using that, instead of the
path we explicitly hardcoded. Fixing the bug broke this, and thus
broke the tests.

Instead of hard-coding OCI runtime paths, swap to just using the
runtime name, `runc` or `crun`, and letting Podman figure out
where the runtime lives - it's quite good at that. This should
un-break the tests and make them more durable.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-20 09:20:33 -04:00
OpenShift Merge Robot f9450300b7
Merge pull request #8061 from edsantiago/bats
System tests: remove some misleading 'run's
2020-10-20 07:25:35 -04:00
OpenShift Merge Robot e944544271
Merge pull request #8056 from xordspar0/invalid-image
Make invalid image name error more specific
2020-10-19 15:49:11 -04:00
Jordan Christiansen 8cbf7700a5 Make invalid image name error more specific
Previously, using an invalid image name would produce an error like
this:

    Error: error encountered while bringing up pod test-pod-0: invalid reference format

This message didn't specify that there was an problem with an image
name, and it didn't specify which image name had a problem if there were
multiple. Now the error reads:

    Error: error encountered while bringing up pod test-pod-0: Failed to parse image "./myimage": invalid reference format

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-10-19 10:06:17 -05:00
Ed Santiago b23d430516 System tests: remove some misleading 'run's
The BATS 'run' directive is really quite obnoxious; for the
most part we really don't want to use it. Remove some uses
that snuck in last week, and remove one test (exists) that
can more naturally be piggybacked into an rm test.

While we're at it: in setup(), look for and delete stray
external (buildah) containers. This will be important if
any of the external-container tests fails; this way we
don't leave behind a state that causes subsequent tests
to fail.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-19 08:43:56 -06:00
Daniel J Walsh 3d2ad0f97a
--tls-verify and --authfile should work for all remote commands
These options are now fully supported in the remote API and should no
longer be hidden and/or documented as non supported.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-19 05:55:11 -04:00
OpenShift Merge Robot 7ffcab0854
Merge pull request #7908 from rhatdan/diff
fix podman container exists and diff for storage containers
2020-10-19 02:49:27 -04:00
OpenShift Merge Robot 9d5f28ba9e
Merge pull request #8039 from zhangguanzhang/runlabel-panic
Fix panic when runlabel is missing
2020-10-16 16:10:02 -04:00
OpenShift Merge Robot fe1b6ccc85
Merge pull request #8029 from Luap99/image-trust-show-raw
Fix podman image trust show --raw output
2020-10-16 05:49:49 -04:00
zhangguanzhang 97fec29212 Fix panic when runlabel is missing
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-16 11:09:21 +08:00
Paul Holzinger a261819183 Fix podman image trust show --raw output
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-10-15 19:04:57 +02:00
Daniel J Walsh db23e12611
Add support for external container
External containers are containers created outside of Podman.
For example Buildah and CRI-O Containers.

$ buildah from alpine
alpine-working-container
$ buildah run alpine-working-container touch /test
$ podman container exists --external alpine-working-container

$ podman container diff alpine-working-container
C /etc
A /test

Added --external flag to refer to external containers, rather then --storage.

Added --external for podman container exists and modified podman ps to use
--external rather then --storage.  It was felt that --storage would confuse
the user into thinking about changing the storage driver or options.

--storage is still supported through the use of aliases.

Finally podman contianer diff, does not require the --external flag, since it
there is little change of users making the mistake, and would just be a pain
for the user to remember the flag.

podman container exists --external is required because it could fool scripts
that rely on the existance of a Podman container, and there is a potential
for a partial deletion of a container, which could mess up existing users.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-15 09:51:31 -04:00
Daniel J Walsh 22c8270135
fix podman container exists and diff for storage containers
Current these commands only check if a container exists in libpod. With
this fix, the commands will also check if they are in containers/storage.

This allows users to look at differences within a buildah or CRI-O container.

Currently buildah diff does not exists, so this helps out in that situation
as well as in CRI-O since the cri does not implement a diff command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-15 09:51:15 -04:00
OpenShift Merge Robot 41eda417fe
Merge pull request #8013 from rhatdan/homedir
Setup HOME environment when using --userns=keep-id
2020-10-15 05:09:40 -04:00
Ed Santiago 1646da834c System test additions
- run --userns=keep-id: confirm that $HOME gets set (#8013)

 - inspect: confirm that JSON output is a sane number of
   lines (10 or more), not an unreadable one-liner (#8011
   and #8021). Do so with image, pod, network, volume
   because the code paths might be different.

 - cgroups: confirm that 'run' preserves cgroup manager (#7970)

 - sdnotify: reenable tests, and hope CI doesn't hang. This
   test was disabled on August 18 because CI jobs were hanging
   and timing out. My suspicion was that it was #7316, which
   in turn seems to have hinged on conmon #182. The latter
   was merged on Sep 16, so let's cross our fingers and see
   what happens.

Also: remove inaccurate warning from a networking test.

And, wow, fix is_cgroupsv2(), it has never actually worked.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-14 15:32:02 -06:00
Daniel J Walsh 1814bac92e Setup HOME environment when using --userns=keep-id
Currently the HOME environment is set to /root if
the user does not override it.

Also walk the parent directories of users homedir
to see if it is volume mounted into the container,
if yes, then set it correctly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-14 15:31:56 -06:00
Daniel J Walsh 6ca8067956
Setup HOME environment when using --userns=keep-id
Currently the HOME environment is set to /root if
the user does not override it.

Also walk the parent directories of users homedir
to see if it is volume mounted into the container,
if yes, then set it correctly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-14 16:45:24 -04:00
Jhon Honce eb4a746efc Restore --format table support
* system df
* events
  * fix error handling from go routine
  * update tests to use gomega matchers for better error messages
* system info
* version
* volume inspect

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-13 17:28:45 -07:00
Ed Santiago 2a6a3f333b APIv2 tests: try again to fix them
CI discovered that a lot of networking tests are failing; my
fault, for not having run my tests as root on my laptop.
Disable those.

Also: bump up the ten-request time limit, from 5 to 7 seconds.
Looks like something keeps getting slower and slower, but I
guess there's not much we can do about it.

Also: when we get a mismatch response code (e.g. 500 when we
expect 200), dump the response body and skip any subsequent
response checks.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-12 13:57:59 -06:00
OpenShift Merge Robot 5801a30487
Merge pull request #7994 from edsantiago/fix_apiv2_tests
APIv2 tests: get them passing again
2020-10-12 12:54:14 -04:00
OpenShift Merge Robot 609f230ad7
Merge pull request #7853 from xordspar0/play-kube-limits-#7742
Add support for resource limits to play kube
2020-10-12 12:47:24 -04:00
OpenShift Merge Robot ce7478b15c
Merge pull request #7588 from HarryMichal/add-toolbox-e2e-tests
tests/e2e: Add Toolbox-specific test cases
2020-10-12 11:31:59 -04:00
OpenShift Merge Robot e8f48a11b6
Merge pull request #7983 from mheon/inspect_network_not_running
Include CNI networks in inspect output when not running
2020-10-12 11:08:22 -04:00
Ed Santiago b2e6e4829f APIv2 tests: get them passing again
In the new-Cirrus transition, APIv2 tests were inadvertently
disabled. As expected when tests get disabled, they break.

This commit fixes some failing tests, and comments out others
(with big FIXMEs) because I have neither the expertise nor
time to figure out the real problems.

The big change to test-apiv2 is due to a recently-added
test that looks for an '=' sign in json output. My '=' vs '~'
detector completely barfed on that, and there's just no
way to make it work in a bash 'case' statement. So, switch
to an 'if' with 'expr'.

And, unrelated, fix a longstanding (harmless) bug that was
issuing spurious "expected" messages to the test log; those
should've been going to the full results log.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-12 08:45:39 -06:00
Jordan Christiansen a413d4d77f Add support for resource limits to play kube
Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-10-12 08:38:37 -05:00
OpenShift Merge Robot 212011f166
Merge pull request #7836 from QiWang19/search-tags
Search repository tags using --list-tags
2020-10-12 07:01:10 -04:00
OpenShift Merge Robot 04674298bd
Merge pull request #7949 from edsantiago/bats
system tests: cleanup, and add more tests
2020-10-12 06:13:14 -04:00
Edward Shen eb11e12f35 Add more APIv2 tests for images: push, tag, untag, rmi and image tree.
Signed-off-by: Edward Shen <weshen@redhat.com>
2020-10-09 22:19:04 -04:00
Matthew Heon 77033c4aed Include CNI networks in inspect output when not running
We were only including the CNI Network fields in the output of
`podman inspect` when the container was not running. It's simple
enough to fix (populate with empty structs, since we can't fill
anything without a CNI response to get IP address assigned, etc).

This is necessary for Docker compatibility.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-09 20:20:19 -04:00
OpenShift Merge Robot ffabd57d6d
Merge pull request #7975 from jwhonce/jira/run-898-4
Restore --format table...
2020-10-09 13:20:39 -04:00
Qi Wang 66798e993a Search repository tags using --list-tags
For fix of BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1684263
Add --list-tags to podman search to return a table the repository tags.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-09 11:49:46 -04:00
OpenShift Merge Robot 7348836958
Merge pull request #7973 from jwhonce/jira/run-898-3
Port V1 --format table to V2 podman
2020-10-09 10:58:48 -04:00
OpenShift Merge Robot fa01b838a6
Merge pull request #7891 from rhatdan/rm
This PR allows users to remove external containers directly
2020-10-09 10:55:15 -04:00
Ondřej Míchal a1e1a3af71 tests/e2e: Add Toolbox-specific test cases
In the past, Toolbox[0] has been affected by several of Podman's
bugs/changes of behaviour. This is one of the steps to assure that as
Podman progresses, Podman itself and subsequently Toolbox do not regress.
One of the other steps is including Toolbox's system tests in Podman's
gating systems (which and to what extent is yet to be decided on).

The tests are trying to stress parts of Podman that Toolbox needs for
its functionality: permission to handle some system files, correct
values/permissions/limits in certain parts, management of users and
groups, mounting of paths,.. The list is most likely longer and
therefore more commits will be needed to control every aspect of the
Toolbox/Podman relationship :).

Some test cases in test/e2e/toolbox_test.go rely on some tools being
present in the base image[1]. That is not the case with the common
ALPINE image or the basic Fedora image.

Some tests might be duplicates of already existing tests. I'm more in
favour of having those duplicates. Thanks to that it will be clear what
functionality/behaviour Toolbox requires.

[0] https://github.com/containers/toolbox
[1] https://github.com/containers/toolbox/#image-requirements

Signed-off-by: Ondřej Míchal <harrymichal@seznam.cz>
2020-10-09 16:32:47 +02:00
OpenShift Merge Robot 2694fb85f4
Merge pull request #7974 from andylibrian/kube-generate-support-resource-limits-7855
Add support for resource cpu limit to generate kube
2020-10-09 06:10:45 -04:00
Daniel J Walsh fea78d5530
This PR allows users to remove external containers directly
Currenly if a user specifies the name or ID of an external storage
container, we report an error to them.

buildah from scratch
working-container-2
podman rm working-container-2
Error: no container with name or ID working-container-2 found: no such container

Since the user specified the correct name and the container is in storage we
force them to specify --storage to remove it. This is a bad experience for the
user.

This change will just remove the container from storage.  If the container
is known by libpod, it will remove the container from libpod as well.

The podman rm --storage option has been deprecated, and removed from docs.

Also cleaned documented options that are not available to podman-remote.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-09 06:06:08 -04:00
OpenShift Merge Robot 953e16f31a
Merge pull request #7910 from EduardoVega/7567-podman-configmaps
Enable k8s configmaps as flags for play kube
2020-10-09 06:01:50 -04:00
Jhon Honce f128bff232 Restore --format table...
Following commands:
* systemd generate
* networks inspect
* pod stats
  * Fixed test where format was quoted and then quoted again
  * Fixed bug where output never printed '--' on missed reads
* pod ps

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-08 18:19:37 -07:00
Andy Librian 34a33d614e
Add support for resource cpu limit to generate kube
fixes #7855

Signed-off-by: Andy Librian <andylibrian@gmail.com>
2020-10-09 05:54:16 +07:00
OpenShift Merge Robot 2a63795338
Merge pull request #7966 from baude/issue7950
add compatibility endpoint for exporting multiple images
2020-10-08 18:11:59 -04:00
Jhon Honce e9b667bb5f Port V1 --format table to V2 podman
* volume ls
* container ps
* updated broken tests when skip removed

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-08 14:55:58 -07:00
OpenShift Merge Robot 0afbe2d152
Merge pull request #7951 from mheon/fix_7947
Ports given only by number should have random host port
2020-10-08 14:17:26 -04:00
baude 78a06c2802 add compatibility endpoint for exporting multiple images
with the recent inclusion of dealing with multiple images in a tar archive, we can now add a compatibility endpoint that was missing images/get?names=one,two.

Fixes: #7950

Signed-off-by: baude <bbaude@redhat.com>
2020-10-08 11:55:47 -05:00
Matthew Heon b754ba9753 Ports given only by number should have random host port
In Podman 1.9.3, `podman run -p 80` would assign port 80 in the
container to a random port on the host. In Podman 2.0 and up, it
assigned Port 80 in the container to Port 80 on the host. This is
an easy fix, fortunately - just need to remove the bit that
assumed host port, if not given, should be set to container port.

We also had a test for the bad behavior, so fix it to test for
the correct way of doing things.

Fixes #7947

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-08 09:16:10 -04:00
OpenShift Merge Robot 59b5f0ac32
Merge pull request #7932 from jwhonce/jira/run-898
Restore V1 --format "table..." support
2020-10-07 16:11:07 -04:00
OpenShift Merge Robot 0e1d01103e
Merge pull request #7382 from mheon/pod_parallel
Move pod jobs to parallel execution
2020-10-07 15:06:02 -04:00
OpenShift Merge Robot 9ae873e60e
Merge pull request #7943 from baude/issue7807
prevent unpredictable results with network create|remove
2020-10-07 13:56:56 -04:00
Jhon Honce b490905f26 Port commands to V2 --format 'table...'
* 'containers mount'
 * 'image history'
 * 'images mount'
 * 'images search'
 * Correct spelling errors

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-07 10:40:30 -07:00
OpenShift Merge Robot 173e3c2faa
Merge pull request #7937 from rhatdan/size
Populate /etc/hosts file when run in a user namespace
2020-10-07 13:29:04 -04:00
Ed Santiago 0ab9e39064 system tests: cleanup, and add more tests
- images test: add test for 'table' and '\t' formatting

 - image mount test: check output from 'umount', test
   repeat umount (NOP), and test invalid-umount

 - kill test: remove kludgy workaround for crun signal bug
   ref: #5004 -- code is no longer needed (fingers crossed),
   and the workaround involved pulling an expensive image.

 - selinux test: add new tests for shared context in:
   * pods , w/ and w/o infra container (ref: #7902)
   * containers with namespace sharing: --ipc, --pid, --net

 - selinux test: new test for --pid=host (disabled pending
   propagation of container-selinux-2.146, ref: #7939)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-07 10:43:02 -06:00
baude fe3faa517e prevent unpredictable results with network create|remove
due to a lack of "locking" on cni operations, we could get ourselves in trouble when doing rapid creation or removal of networks.  added a simple file lock to deal with the collision and because it is not considered a performent path, use of the file lock should be ok.  if proven otherwise in the future, some generic shared memory lock should be implemented for libpod and also used here.

moved pkog/network to libpod/network because libpod is now being pulled into the package and it has therefore lost its generic nature. this will make it easier to absorb into libpod as we try to make the network closer to core operations.

Fixes: #7807

Signed-off-by: baude <bbaude@redhat.com>
2020-10-07 10:03:21 -05:00
Eduardo Vega 39dde9bcb7 Enable k8s configmaps as flags for play kube
Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com>
2020-10-07 08:54:24 -06:00
Daniel J Walsh ccc5bc167f
Attempt to turn on some more remote tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-07 10:19:08 -04:00
Matthew Heon 55f5e4af11 Use WaitWithDefaultTimeout in cleanup
Ensure that we actually print the output of all commands when
cleaning up the results of the E2E tests.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-10-07 10:00:11 -04:00
Daniel J Walsh 3ae47f7d2b
Populate /etc/hosts file when run in a user namespace
We do not populate the hostname field with the IP Address
when running within a user namespace.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-07 08:39:44 -04:00
OpenShift Merge Robot defb754945
Merge pull request #7918 from zhangguanzhang/apiv2-wrong-StopSignal
[apiv2] /containers/$name/json return wrong value in `.Config.StopSignal`
2020-10-06 13:17:15 +02:00
zhangguanzhang adde67c74f fix apiv2 /containers/$name/json return wrong value in .Config.StopSignal
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-06 11:15:25 +08:00
Daniel J Walsh 348f2df0c0
Support max_size logoptions
Docker supports log-opt max_size and so does conmon (ALthough poorly).
Adding support for this allows users to at least make sure their containers
logs do not become a DOS vector.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-05 17:51:45 -04:00
OpenShift Merge Robot 436dda2385
Merge pull request #7913 from andylibrian/kube-generate-support-resource-limits-7855
Add support for resource memory limit to generate kube
2020-10-05 12:15:04 +02:00
OpenShift Merge Robot a9d572f40f
Merge pull request #7909 from zhangguanzhang/remote-ps-ns-broken
Fix podman-remote ps --ns broken
2020-10-05 12:11:41 +02:00
OpenShift Merge Robot 7353000a06
Merge pull request #7902 from rhatdan/selinux
Add SELinux support for pods
2020-10-05 10:32:28 +02:00
Andy Librian d6258eb6c2
Add support for resource memory limit to generate kube
addresses #7855

Signed-off-by: Andy Librian <andylibrian@gmail.com>
2020-10-04 21:17:00 +07:00
zhangguanzhang 4a2c4c3989 Fix podman-remote ps --ns broken
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-04 19:48:13 +08:00
OpenShift Merge Robot 01c7ae6407
Merge pull request #7856 from rhatdan/root
podman-remote does not support most of the global flags
2020-10-02 16:37:43 -04:00
Daniel J Walsh d0f3c17912
Add SELinux support for pods
All containers within a Pod need to run with the same SELinux
label, unless overwritten by the user.

Also added a bunch of SELinux tests to make sure selinux labels
are correct on namespaces.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-02 15:14:18 -04:00
OpenShift Merge Robot d4e97b35c2
Merge pull request #7901 from vrothberg/fix-compat-images-create
compat: images/create: fix tag parsing
2020-10-02 14:52:38 -04:00
OpenShift Merge Robot f1cdead33d
Merge pull request #7199 from jwhonce/jira/run-898
Restore "table" --format from V1
2020-10-02 14:49:02 -04:00
OpenShift Merge Robot 819a4e0288
Merge pull request #7895 from zhangguanzhang/run-ctr-restartPolicy-with-rm
[podman run] --rm option shold conflicts with --restart
2020-10-02 14:28:25 -04:00
OpenShift Merge Robot 1132bcfeb5
Merge pull request #7893 from ashley-cui/journald
Fix Podman logs reading journald
2020-10-02 14:24:53 -04:00
Valentin Rothberg 6a291942c2 compat: images/create: fix tag parsing
The `tag` parameter of the compat `images/create` endpoint can be both,
a tag and a digest.  Fix parsing of the parameter to detect digests and
use the appropriate `@` separator.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-10-02 17:24:37 +02:00
OpenShift Merge Robot 1784f4f338
Merge pull request #7873 from edsantiago/logformatter_env
logformatter: add Synopsis at top of each page
2020-10-02 11:24:31 -04:00
Ashley Cui c0d1954663 Fix Podman logs reading journald
A podman could not read logs written to journald properly, due to a tail config bug.
Added a system test to check this - since e2e tests don't like journald

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-10-02 10:05:19 -04:00
Jhon Honce c0757374bf Restore "table" --format from V1
* --format "table {{.field..." will print fields out in a table with
  headings.  Table keyword is removed, spaces between fields are
  converted to tabs
* Update parse.MatchesJSONFormat()'s regex to be more inclusive
* Add report.Headers(), obtain all the field names to be used as
  column headers, a map of field name to column headers may be provided
  to override the field names
* Update several commands to use new functions

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-02 06:58:02 -07:00
zhangguanzhang 1492f3c936 --rm option shold conflicts with --restart
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-02 21:57:37 +08:00
Daniel J Walsh b3f17936aa
podman-remote does not support most of the global flags
podman-remote --help is showing a bunch of global flags that it
does not support

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-02 06:32:17 -04:00
OpenShift Merge Robot defd427503
Merge pull request #7869 from vrothberg/system-untag
system test: untag all test
2020-10-02 03:22:25 -04:00
Ed Santiago d380ba0394 logformatter: add Synopsis at top of each page
At the top of each generated page, add a Synopsis table with:

  PR number/name, and link to github
  Author name(s)
  Test name (fedora/ubuntu, rootless, etc)
  Cirrus build ID (usually uninteresting)
  Cirrus task ID (usu. important), with link to Cirrus
  The value of $SPECIALMODE

This is all we can get from the Cirrus environment in
which logformatter runs; we can't get things like
cgroup manager or username that the test runs under.

Note that the table is at the top, which is usually
unseen because we autoscroll to the bottom on
page load. I tentatively think that top is a more
natural place for this info than bottom, but am
willing to listen to arguments against.

Also, one minor tweak: highlight podman commands in
the BATS output. The idea is to make it easier for the eye
to spot those, then copy/paste them to find a reproducer.

And, sigh, disable the new 'podman network create'
system test. It is flaking much too much.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-01 20:33:20 -06:00
OpenShift Merge Robot 6a2c7d8831
Merge pull request #7849 from baude/f33tests
misc fixes for f33 integration tests
2020-10-01 16:35:29 -04:00
OpenShift Merge Robot 5d22eb02f9
Merge pull request #7735 from QiWang19/manifest-inspect
fix allowing inspect manifest of non-local image
2020-10-01 13:32:02 -04:00
OpenShift Merge Robot 11dfe9385c
Merge pull request #7835 from Luap99/network-test-cleanup
Fix some flakes in the e2e network tests.
2020-10-01 12:43:52 -04:00
Valentin Rothberg 7951a7f13a system test: untag all test
Extend the system tests to test `podman untag $image` without further
arguments to force removing all tags from the image.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-10-01 18:34:08 +02:00
OpenShift Merge Robot a29ef605f9
Merge pull request #7846 from rhatdan/rootless
Attempt to test all Broken SkipIfRootless FIXME
2020-10-01 12:08:14 -04:00
OpenShift Merge Robot 3948cb76e2
Merge pull request #7851 from zhangguanzhang/fix-apiv2-ctr-workdir-and-env
[apiv2] don't ignore the ENV and WorkDir from the image
2020-10-01 10:00:15 -04:00
Paul Holzinger 45b73c1ed7 Fix some flakes in the e2e network tests.
The network test created config files with random filenames
but the network name was static. Since the tests can run in
parallel podman was not able to distinguish the networks.
We need to make sure that each test has its own config file
and network name. This helps to prevent unnecessary flakes.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-10-01 15:56:59 +02:00
OpenShift Merge Robot 556117c2e9
Merge pull request #7848 from cevich/fix_tests
Fix two e2e tests
2020-10-01 06:05:00 -04:00
OpenShift Merge Robot c70f5fb19b
Merge pull request #7823 from vrothberg/fix-6381
image look up: consult registries.conf
2020-10-01 03:31:06 -04:00
zhangguanzhang cde367c1c0 fix: The container created by APIV2 has an incorrect Env and WorkDir
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-01 05:13:01 +08:00
baude df532ee8c1 misc fixes for f33 integration tests
some small fixes for testing on fedora 33 (non-btrfs)

Signed-off-by: baude <bbaude@redhat.com>
2020-09-30 14:15:59 -05:00
OpenShift Merge Robot 1d7cb7f477
Merge pull request #7798 from QiWang19/run-manifest
Use local image if input image is a manifest list
2020-09-30 18:38:07 +00:00
Qi Wang 7ac8000cc1 fix allowing inspect manifest of non-local image
Add support of `podman manifest inspect` returning manifest list of non-local manifest.
Close #https://github.com/containers/podman/issues/7726

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-30 14:12:32 -04:00
Chris Evich d4ca13f7c0
Distinguish userns vs containerized tests
The systemd test was inaccurately being skipped when a userns env. var.
flag was set.  At best this is confusing to new developers, and at worse
it actively blocks an otherwise legitimate class of tests.  Improve the
accuracy of skip-logic by adding/using a purpose built set of
functions.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-09-30 13:33:57 -04:00
OpenShift Merge Robot f86e01ab10
Merge pull request #7820 from giuseppe/fix-capabilities-not-root
capabilities: always set ambient and inheritable
2020-09-30 17:22:54 +00:00
OpenShift Merge Robot e2050d7c35
Merge pull request #7847 from rhatdan/network
Make the e2e test network cleanup more robust.
2020-09-30 16:07:26 +00:00
Qi Wang d24ec64887 Use local image if input image is a manifest list
If run&create image returns error: image contains manifest list, not a runnable image, find the local image that has digest matching the digest from the list and use the image from local storage for the command.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-30 10:38:02 -04:00
Valentin Rothberg 8ff35a098c image look up: consult registries.conf
When looking up local images, take the unqualified-serach registries of
the registries.conf into account (on top of "localhost/").

Also extend the integration tests to prevent future regressions.

Fixes: #6381
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-30 16:30:41 +02:00
Daniel J Walsh bad761e7c7
Attempt to test all Broken SkipIfRootless FIXME
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-30 10:01:57 -04:00
Daniel J Walsh 5766f5b587
Make the e2e test network cleanup more robust.
We need to handle removal of non existing network.

This allows the `removeCNINetwork` function
always to be called. This is needed by tests which are trying
to remove the network manually in order to prevent flakes.

Fixes #7809

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-30 09:50:59 -04:00
Chris Evich f32fa3dd59
Fix ubuntu exec_test
Test passes on Fedora because the registry server is one of the
defaults.  However it is not typically configured on Ubuntu hosts, and
therefor this test can fail.  While specifying the FQIN in the
dockerfile text is not an ideal solution, it cannot negatively
affect other tests which utilize `podmanTest.BuildImage`.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-09-30 09:24:01 -04:00
Giuseppe Scrivano 703381b4a2
capabilities: always set ambient and inheritable
change capabilities handling to reflect what docker does.

Bounding: set to caplist
Inheritable: set to caplist
Effective: if uid != 0 then clear; else set to caplist
Permitted: if uid != 0 then clear; else set to caplist
Ambient: clear

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-09-30 15:14:07 +02:00
OpenShift Merge Robot 4d57313449
Merge pull request #7840 from vrothberg/remote-untag
fix remote untag
2020-09-30 12:58:08 +00:00
OpenShift Merge Robot 08d036cbd4
Merge pull request #7825 from rhatdan/exitcode
Fix handling of remove of bogus volumes, networks and Pods
2020-09-30 11:33:19 +00:00
Valentin Rothberg 1a3e409412 fix remote untag
Fix the remote client to untag all tags of the specified image.
Instead of querying the image on the client side, support the
case where both, repo and tag, are empty and remove all tags.

Reuse the ABI implementation where possible.  In retrospective,
the libpod untag endpoint should support a slice of strings to
batch remove tags rather than reaching out for each tag individually.

Enable the skipped test.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-30 11:57:31 +02:00
OpenShift Merge Robot e9edddaaf2
Merge pull request #7799 from rhatdan/rootless
Make all Skips specify a reason
2020-09-30 09:18:41 +00:00
OpenShift Merge Robot b68b6f334d
Merge pull request #7832 from edsantiago/bats_run_tz
System tests: add podman run --tz
2020-09-30 00:24:55 +00:00
Daniel J Walsh b496802413
Make all Skips specify a reason
Always use CGROUPV2 rather then reading from system all the time.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-29 16:01:26 -04:00
Daniel J Walsh 22474095ab
Fix handling of remove of bogus volumes, networks and Pods
In podman containers rm and podman images rm, the commands
exit with error code 1 if the object does not exists.

This PR implements similar functionality to volumes, networks, and Pods.

Similarly if volumes or Networks are in use by other containers, and return
exit code 2.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-29 15:52:43 -04:00
Ed Santiago 258ccfc3c9 System tests: add podman run --tz
New tests for podman run --tz=EXPLICIT and =local. Requires
updating our testimage by adding a fixed reference timestamp
to a known file path.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-29 12:23:58 -06:00
Ed Santiago 81d9ba59db System tests: corner case for run --pull
Obscure corner case in which 'podman run --pull=never alpine'
will actually pass *with no alpine image* if there's an
image named "myalpine". (i.e. a substring match, not full
string match). Fixed in #7770 but the tests that were added
there do not actually test that.

This adds a double-duty test for that as well as making
sure that 'run --pull=never SHORTNAME' (implicit :latest)
does not match our existing :YYYYMMDD image; then one
more quick test to make sure that if we tag as :latest,
the same --pull=never succeeds.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-29 10:56:40 -06:00
OpenShift Merge Robot 63f0bb93f8
Merge pull request #7783 from ashley-cui/slirp
Add support for slirp network for pods
2020-09-29 15:34:37 +00:00
OpenShift Merge Robot 53aa9764c4
Merge pull request #7822 from edsantiago/bats
Gating-test fix: deal with new crun error msg
2020-09-29 15:21:09 +00:00
OpenShift Merge Robot bf10168614
Merge pull request #7811 from rhatdan/sysctls
Ignore containers.conf sysctl when namespaces set to host
2020-09-29 14:59:16 +00:00
Ed Santiago f732e2edcb Gating-test fix: deal with new crun error msg
crun changed an error message:

   https://github.com/containers/crun/pull/439

It's a good change, absolutely the right thing to do, but
it broke gating tests. Fix tests so they handle both old
and new format.

Fixes: #7814

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-29 06:20:21 -06:00
OpenShift Merge Robot 4a7fb62adc
Merge pull request #7803 from edsantiago/bats
System tests: reenable some skipped tests
2020-09-29 01:45:20 +00:00
OpenShift Merge Robot e7e466e0c8
Merge pull request #7805 from Luap99/journald-test
Journald log driver test
2020-09-28 21:04:55 +00:00
Daniel J Walsh 0d70df1195
Ignore containers.conf sysctl when namespaces set to host
If user sets namespace to host, then default sysctls need to be ignored
that are specific to that namespace.

--net=host ignore sysctls that begin with net.
--ipc=host ignore fs.mqueue
--uts=host ignore kernel.domainname and kernel.hostname

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-28 16:17:28 -04:00
Ed Santiago 1f78d33f76 System tests: reenable some skipped tests
- pause test: enable when rootless + cgroups v2
   (was previously disabled for all rootless)

 - run --pull: now works with podman-remote
   (in #7647, thank you @jwhonce)

 - various other run/volumes tests: try reenabling
   It looks like #7195 was fixed (by #7451? I'm not
   sure if I'm reading the conversation correctly).
   Anyway, remove all the skip()s on 7195. Only time
   will tell if it's really fixed)

Also:

 - new test for podman image tree --whatrequires
   (because TIL). Doesn't work with podman-remote.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-28 13:59:42 -06:00
Paul Holzinger 1db49d95b7 Journald log driver test
Test that the journald log driver writes to journald and
that we can read it with journalctl.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-28 20:48:12 +02:00
OpenShift Merge Robot b0e70a6411
Merge pull request #7786 from rhatdan/rootless
Remove SkipIfRootless if possible, document other calls
2020-09-28 14:43:46 +00:00
OpenShift Merge Robot d2802636b0
Merge pull request #7770 from rhatdan/pullpolicy
Properly handle podman run --pull command
2020-09-28 14:36:43 +00:00
Paul Holzinger 343a10e25f Fix network remove for the podman remote client
The podman remote client ignored the force option due a typo.
If an error occured the remote client would panic with an
index out of range error.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-28 13:34:56 +02:00
Paul Holzinger 393120c135 Fix podman network rm --force when network is used by a pod
I added a test to prevent a future regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-28 10:41:25 +02:00
Daniel J Walsh 007c0ecd50
Remove SkipIfRootless if possible, document other calls
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-27 07:55:16 -04:00
Daniel J Walsh 1b5853e647
Properly handle podman run --pull command
Currently the --pull missing|always|never is ignored

This PR implements this for local API.  For remote we
need to default to pullpolicy specified in the containers.conf
file.

Also fixed an issue when images were matching other images names
based on prefix, causing images to always be pulled.

I had named an image myfedora and when ever I pulled fedora, the system
thought that it there were two images named fedora since it was checking
for the name fedora as well as the prefix fedora.  I changed it to check
for fedora and the prefix /fedora, to prefent failures like I had.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-27 07:25:28 -04:00
Ashley Cui b6176d8987 Add support for slirp network for pods
flag --network=slirp4netns[options] for root and rootless pods

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-09-25 21:34:23 -04:00
OpenShift Merge Robot b9d77796c0
Merge pull request #7687 from edsantiago/bats
system tests: new tests
2020-09-25 16:06:07 +00:00
Daniel J Walsh ff63715485
Remove some SkipIfRootess flags from tests
We need to get more tests running in rootless mode.  Since cgroupsV2 allows
management of cgroups in rootless environments a lot of more tests can be run.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-25 05:06:28 -04:00
OpenShift Merge Robot 0839300a71
Merge pull request #7758 from edsantiago/test_log_driver
system tests: new test for run --log-driver
2020-09-24 16:57:05 +00:00
OpenShift Merge Robot 0f5f8dcdd3
Merge pull request #7741 from vrothberg/remote-load-dir-check
remote load: check if input is directory
2020-09-24 16:53:48 +00:00
OpenShift Merge Robot 3957058f29
Merge pull request #7753 from vrothberg/fix-7689
remote stats
2020-09-24 15:32:36 +00:00
Valentin Rothberg 1f66a827e8 remote load: check if input is directory
The remote client does not support loading directories yet.  To prevent
confusing error messages and to make the behaviour more explicit, check
if the input points to a directory and throw an error if needed.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-24 14:40:54 +02:00
Valentin Rothberg 762b787fbf new endpoint: /libpod/containers/stats
Add a new endpoint for container stats allowing for batch operations on
more than one container.  The new endpoint deprecates the
single-container endpoint which will eventually be removed with the next
major release.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-24 14:09:55 +02:00
OpenShift Merge Robot 08cc91926d
Merge pull request #7763 from edsantiago/bats_better_parse_table
system tests: helpers: safer parse_table
2020-09-24 09:50:11 +00:00
OpenShift Merge Robot c3d1cefa02
Merge pull request #7739 from zhangguanzhang/apiv2-containers-limit
apiv2 /containers/json limit differ from docker-api
2020-09-24 09:43:19 +00:00
zhangguanzhang 873989f7a4 apiv2 container limit differ from docker-api
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-09-24 08:54:46 +08:00
OpenShift Merge Robot c256944d00
Merge pull request #7759 from xordspar0/app-filter
Allow filtering on pod label values
2020-09-24 00:11:45 +00:00
Ed Santiago e628487525 system tests: helpers: safer parse_table
The parse_table() helper has until now dumbly split lines
on every single '|' character. This prevents us from running
simple tests such as 'cgroupManager: (systemd|cgroupfs)'.

We now use an ugly but robust sed expression to split
on '|' but *only* when surrounded by spaces and/or beginning
or end of line. This is safe because, for readability, all
tables already keep the '|' symbols well separated from
table content.

Add tests. And, the whole reason behind this, add
an actual real test for cgroupManager and cgroupVersion.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-23 16:38:05 -06:00
Ed Santiago b60bb3b622 system tests: new test for run --log-driver
Tests all (current) values for --log-driver=X, and one test
for invalid value. For those drivers that write a local
file (json-file, k8s-file), test that the file exists and
contains results of the expected form (timestamp, stdout,
'F' for 'F'ull line, and the expected string output.

For json-file, confirm that podman issues a "Choosing k8s-file"
warning (only on local. On podman-remote, the warning goes only
to the server's stderr).

Written in response to #7754 in which driver=json-file was
falling through to 'none' instead of 'k8s-file'.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-23 15:16:54 -06:00
Jordan Christiansen 393fa4b92f Allow filtering on pod label values
Before this change, filters of the form `podman pod ps --filter
label=app=myapp` were not working. The results would include all pods
that contained the app label with any value. Looking at the code, this
makes sense. It appears that the second = and everything after it were
getting truncated.

Even though there was already a passing test that tested `podman pod ps
--filter label=io.podman.test.label=value1`, the test failed with the
above example with a label `app=myapp`. The new code works in both
cases.

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-09-23 15:26:12 -05:00
Daniel J Walsh 8863e0f005
Remove final v2remotefail failures
Most have been fixed, others I replaced with SkipIfRemote

Fix ContainerStart on tunnel, it needs to wait for the exit status
before returning.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-23 14:50:22 -04:00
OpenShift Merge Robot 81c543bbe3
Merge pull request #7745 from rhatdan/systemd
Systemd should be able to run as rootless
2020-09-23 17:52:14 +00:00
Ed Santiago b7147afde9 e2e tests: SkipIfRemote(): add a reason
Now that Dan has added helpful comments to each SkipIfRemote,
let's take the next step and include those messages in the
Skip() output so someone viewing test results can easily
see if a remote test is skipped for a real reason or for
a FIXME.

This commit is the result of a simple:

   perl -pi -e 's;(SkipIfRemote)\(\)(\s+//\s+(.*))?;$1("$3");' *.go

in the test/e2e directory, with a few minor (manual) changes
in wording.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-23 08:09:31 -06:00
OpenShift Merge Robot 7d273c40f5
Merge pull request #7727 from rhatdan/attach
Examine all SkipIfRemote functions
2020-09-23 13:02:53 +00:00
Daniel J Walsh 3532bc688e
Systemd should be able to run as rootless
Turn on most of the systemd tests for rootless.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-23 07:06:32 -04:00
OpenShift Merge Robot 2270be1871
Merge pull request #7729 from mheon/info_cgroup_manager
Include cgroup manager in `podman info` output
2020-09-22 21:00:57 +00:00
Daniel J Walsh a277b7eb0b
Examine all SkipIfRemote functions
Remove ones that are not needed.
Document those that should be there.
Document those that should be fixed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-22 16:55:37 -04:00
OpenShift Merge Robot fac9252205
Merge pull request #7719 from vrothberg/fix-multi-image-save
podman save: fix redirect of multi-images
2020-09-22 17:40:16 +00:00
Matthew Heon 99386c7ae7 Include cgroup manager in podman info output
This is very useful for debugging cgroups v2, especially on
rootless - we need to ensure people are correctly using systemd
cgroups in these cases.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-09-22 13:15:01 -04:00
Valentin Rothberg 78afe67e00 podman save: fix redirect of multi-images
Fix a bug when saving multi-image archives where the progress bars from
copying images was accidentally written to the archive and hence
corrupted it.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-22 17:04:38 +02:00
OpenShift Merge Robot 6900b5a2be
Merge pull request #7717 from rhatdan/attach
Fix up attach tests for podman remote
2020-09-22 13:06:53 +00:00
OpenShift Merge Robot 141688cd6f
Merge pull request #7691 from rhatdan/mount
Fix podman image unmount to only report images unmounted
2020-09-22 12:43:56 +00:00
Daniel J Walsh f949cfddaa
Fix up attach tests for podman remote
When we execute podman-remote attach, we were not checking if the
container was in the correct state, this is leading to timeouts and
we had turned off remote testing.

Also added an IfRemote() function so we can turn on more tests when
using the "-l" flag for local, but use container name for remote.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-22 06:19:59 -04:00
Jhon Honce e06230c9d5 Restore 'id' stanza in pull results
id is the last image id from the set of id's returned via the images
stanza.

id may be deprecated in a future version of the API

Created test_rest_v2_0_0.py to reflect the bump in the API Version.

Fixes #7686

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-21 08:51:52 -07:00
Daniel J Walsh 0f9a2735b7
Fix podman image unmount to only report images unmounted
Currently `podman image unmount` report every image that is mounted
when it unmounts them. We should only report unmounted actually mounted images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-21 11:08:23 -04:00
OpenShift Merge Robot e9ddfa0518
Merge pull request #7697 from rhatdan/ignore
Fix handling of podman-remote stop --ignore
2020-09-21 10:12:01 -04:00
OpenShift Merge Robot 0a46b9c9e6
Merge pull request #7696 from jwhonce/wip/version
Refactor version handling in cmd tree
2020-09-21 13:23:20 +00:00
Paul Holzinger 44d7270a34 Fix incorrect parsing of create/run --volumes-from
Add a bunch of tests to ensure that --volumes-from
works as expected.

Also align the podman create and run man page.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-20 22:49:09 +02:00
Ed Santiago bd3c66fc81 system tests: new tests
- podman network create: new test

- podman pull by-sha + podman images -a (#7651)

- podman image mount: new test

- podman pod: --infra-image and --infra-command (#7167)

For convenience and robustness, build a new testimage
containing a custom file /home/podman/testimage-id
with contents YYYYMMDD (same as image tag). The
image-mount test checks that this file exists and
has the desired content. New testimage also includes
a dummy 'pause' executable, for testing pod infra.

Updates from testimage:20200902 to :20200917

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-19 15:55:00 -06:00
OpenShift Merge Robot c2068f11cc
Merge pull request #7694 from mheon/fix_exec_supplemental_groups
Preserve groups in exec sessions in ctrs with --user
2020-09-19 06:32:59 -04:00
Daniel J Walsh 1b610e93d2
Fix handling of podman-remote stop --ignore
This patch simplifies the hanlding of rhe --ignore flag, for podman stop, rm

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-19 06:21:18 -04:00
Jhon Honce c4b49afad3 Refactor version handling in cmd tree
* Move from simple string to semver objects
* Change client API Version from '1' to 2.0.0

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-18 15:13:58 -07:00
Matthew Heon 2f605dcc1c Preserve groups in exec sessions in ctrs with --user
Podman wants to guarantee that exec sessions retain the groups of
the container they are started in, unless explicitly overridden
by the user. This guarantee was broken for containers where the
`--user` flag was specified; this patch resolves that.

Somewhere in the Exec rewrite for APIv2, I changed the location
where the container's User is passed into the exec session
(similar to groups, we also want to preserve user unless
overridden). The lower-level Exec APIs already handled setting
user and group appropriately if not specified when the exec
session was created, but I added duplicate code to handle this
higher in the stack - and that code only handled setting user,
not supplemental groups, breaking support in that specific case.

Two things conspired to make this one hard to track down: first,
things were only broken if the container explicitly set a user;
otherwise, the container user would still appear to be unset to
the lower-level code, which would properly set supplemental
groups (this tricked our existing test into passing). Also, the
`crun` OCI runtime will add the groups without prompting, which
further masked the problem there. I debated making `runc` do the
same, but in the end it's better to fix this in Podman - it's
better to be explicit about what we want done so we will work
with all OCI runtimes.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-09-18 13:54:25 -04:00
OpenShift Merge Robot 273b9545bb
Merge pull request #7679 from baude/remoteiidfile
enable --iidfile for podman-remote build
2020-09-18 06:26:18 -04:00
OpenShift Merge Robot fc131a207e
Merge pull request #7671 from zhangguanzhang/play-kube-handle-restartPolicy
handle the restartPolicy for play kube and generate kube
2020-09-18 06:19:19 -04:00
zhangguanzhang f0ccac199b handle the play kube and generate kube for with restartPolicy
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-09-18 13:28:22 +08:00
zhangguanzhang 5f6fff0899 fix the .Path and .Args when use the infra-command
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-09-18 09:57:54 +08:00
baude ec58650939 enable --iidfile for podman-remote build
for podman-remote build operations, the iidfile, when used, needs to write the file to the client's local filesystem.

Signed-off-by: baude <bbaude@redhat.com>
2020-09-17 12:55:48 -05:00
Jordan Christiansen 7837afe165 Fix play_kube_test deployment template
Annotations were at the wrong indentation, making them a part of the
labels map.

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-09-17 10:04:56 -05:00
OpenShift Merge Robot d8414add00
Merge pull request #7654 from vrothberg/fix-7651
image list: return all associated names
2020-09-17 09:36:49 -04:00
Valentin Rothberg ecae5f7ade image list: return all associated names
Always return all associated names / repo tags of an image and fix a bug
with malformed repo tags.

Previously, Podman returned all names only with `--all` but this flag
only instructs to list intermediate images and should not alter
associated names.  With `--all` Podman queried the repo tags of an image
which splits all *tagged* names into repository and tag which is then
reassembled to eventually be parsed again in the frontend.  Lot's of
redundant CPU heat and buggy as the reassembly didn't consider digests
which ultimately broke parsing in the frontend.

Fixes: #7651
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-17 12:23:58 +02:00
Jordan Christiansen 55dfa7fad2 Add labels to a pod created via play kube
When using `podman play kube` with a YAML file that has pod labels,
apply those labels to the pods that podman makes.

For example, this Deployment spec has labels on a pod:

	apiVersion: apps/v1
	kind: Deployment
	metadata:
	  name: myapp
	  labels:
	    app: myapp
	spec:
	  selector:
	    matchLabels:
	      app: myapp
	  template:
	    metadata:
	      labels:
		app: myapp
	    spec:
	      containers:
	      - name: web
		image: nginx
		ports:
		- containerPort: 80

The pods that podman creates will have the label "app" set to "myapp" so
that these pods can be found with `podman pods ps --filter label=app`.

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-09-16 15:46:08 -05:00
Daniel J Walsh b3d6383f25
Fix podman pod create --infra-command and --infra-image
Currently infr-command and --infra-image commands are ignored
from the user.  This PR instruments them and adds tests for
each combination.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-16 07:42:19 -04:00
OpenShift Merge Robot 0d14d7b715
Merge pull request #7624 from QiWang19/policy-option
Supports import&run--signature-policy
2020-09-16 11:05:33 +02:00
OpenShift Merge Robot b9c47fa40b
Merge pull request #7636 from vrothberg/fix-7407
run/create: record raw image
2020-09-16 09:00:47 +02:00
OpenShift Merge Robot 26049193e0
Merge pull request #7642 from jwhonce/issues/7327-2
Refactor API version values
2020-09-16 04:06:30 +02:00
Qi Wang 2fcd1d7b4d Supports import&run--signature-policy
Enables podman create, pull, run, import to use --signature-policy option. Set it as hidden flag to be consistent with other commands.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-15 16:09:33 -04:00
Jhon Honce 8a8bae8299 Refactor API version values
* API-Version header now Major.Minor to support tools parsing this
   header
 * Libpod Version updated to 2.0.0 to reflect changes in API field
   values
 * API-Version and Libpod-API-Version headers are now included in all
   results

Fixes #7327

 * Header support tested against goland 2020.2 and
    https://www.jetbrains.com/help/idea/docker.html plugin

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-15 11:29:45 -07:00
OpenShift Merge Robot e7af517914
Merge pull request #7633 from edsantiago/minus_l_with_other_args
Usability: prevent "-l" with arguments
2020-09-15 19:58:19 +02:00
Valentin Rothberg ce6efadd5c run/create: record raw image
Record the user-specified "raw" image name in the SpecGenerator, so we
can pass it along to the config when creating a container.  We need a
separate field as the image name in the generator may be set to the
ID of the previously pulled image - ultimately the cause of #7404.

Reverting the image name from the ID to the user input would not work
since "alpine" for pulling iterates over the search registries in the
registries.conf but looking up "alpine" normalizes to
"localhost/alpine".

Recording the raw-image name directly in the generator was the best of
the options I considered as no hidden magic from search registries or
normalizations (that may or may not change in the future) can interfere.
The auto-update backend enforces that the raw-image name is a
fully-qualified reference, so we need to worry about that in the front
end.

Fixes: #7407
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-15 13:33:22 +02:00
OpenShift Merge Robot 3b4ad9a81d
Merge pull request #7452 from jwhonce/issues/7136
Refactor API build endpoint to be more compliant
2020-09-15 12:17:12 +02:00
Paul Holzinger 685ef847dd podman wait accept args > 1
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-15 00:02:45 +02:00
Ed Santiago 2583948f72 Usability: prevent "-l" with arguments
Add new system check confirming that "podman foo -l arg"
throws an error; and fix lots of instances where code
was not doing this check.

I'll probably need to add something similar for --all but
that can wait.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-14 15:49:28 -06:00
Jhon Honce 146c68f3ac Refactor API build endpoint to be more compliant
* Refactor/Rename channel.WriteCloser() to encapsulate the channel
* Refactor build endpoint to "live" stream buildah output channels
  over API rather then buffering output
* Refactor bindings/tunnel build because endpoint changes
  * building tar file now in bindings rather then depending on
    caller
* Cleanup initiating extra image engine
* Remove setting fields to zero values (less noise in code)
* Update tests to support remote builds

Fixes #7136
Fixes #7137

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-09-14 13:46:59 -07:00
OpenShift Merge Robot d7db1da789
Merge pull request #7600 from rhatdan/codespell
Fix up errors found by codespell
2020-09-11 11:30:05 -04:00
OpenShift Merge Robot 881f2dfe92
Merge pull request #7403 from QiWang19/runtime-flag
Add global options --runtime-flags
2020-09-11 11:00:11 -04:00
Daniel J Walsh 526f01cdf5
Fix up errors found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-11 06:14:25 -04:00
OpenShift Merge Robot d1798d0383
Merge pull request #7591 from haircommander/play-kube-process-namespace
play/generate: support shareProcessNamespace
2020-09-11 05:56:35 -04:00
OpenShift Merge Robot e59c3ce1c5
Merge pull request #7593 from edsantiago/network_test_cleanup
run_networking e2e test: add cleanup to some tests
2020-09-11 05:53:19 -04:00
OpenShift Merge Robot 26fb8d2cde
Merge pull request #7586 from ashley-cui/rokube
Add read-only volume mount to play kube
2020-09-11 05:32:42 -04:00