Commit Graph

8429 Commits

Author SHA1 Message Date
OpenShift Merge Robot 988fd27541
Merge pull request #6746 from vrothberg/untag
podman untag: error if tag doesn't exist
2020-06-24 12:19:42 -04:00
Giuseppe Scrivano 061261ee05
utils: drop default mapping when running uid!=0
this is a leftover from the first implementation of rootless.  This
code is never hit by podman rootless anymore as podman automatically
creates a user namespace now.

Fixes an issue with podman remote when used with uid != 0.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-24 18:13:42 +02:00
Valentin Rothberg f80461078e podman run/create: support all transports
Support all image transports in podman run/create.  It seems we
regressed with v2 on that.  Also add tests to make sure we're
not regressing again.

Fixes: #6744
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-24 17:20:04 +02:00
Daniel J Walsh 7330647cbd
Fix inspect to display multiple label: changes
If the user runs a container like

podman run --security-opt seccomp=unconfined --security-opt label=type:spc_t --security-opt label=level:s0 ...

Podman inspect was only showing the second option

This change will show

            "SecurityOpt": [
                "label=type:spc_t,label=level:s0:c60",
                "seccomp=unconfined"
            ],

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-24 11:05:39 -04:00
OpenShift Merge Robot 6bc5dcc282
Merge pull request #6729 from QiWang19/inspect-format
Reformat inspect network settings
2020-06-24 09:35:25 -04:00
Valentin Rothberg 1c6c12581c podman untag: error if tag doesn't exist
Throw an error if a specified tag does not exist.  Also make sure that
the user input is normalized as we already do for `podman tag`.

To prevent regressions, add a set of end-to-end and systemd tests.

Last but not least, update the docs and add bash completions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-24 15:34:46 +02:00
OpenShift Merge Robot c07df63c45
Merge pull request #6741 from maybe-sybr/maybe/apiv2/fix-volume-create-code
APIv2: Return `StatusCreated` from volume creation
2020-06-24 09:32:39 -04:00
OpenShift Merge Robot 179731bb14
Merge pull request #6738 from maybe-sybr/maybe/apiv2/fix-network-compat-urls
APIv2:fix: Remove `/json` from compat network EPs
2020-06-24 09:29:53 -04:00
Matthew Heon 7fe4c5204e Set stop signal to 15 when not explicitly set
When going through the output of `podman inspect` to try and
identify another issue, I noticed that Podman 2.0 was setting
StopSignal to 0 on containers by default. After chasing it
through the command line and SpecGen, I determined that we were
actually not setting a default in Libpod, which is strange
because I swear we used to do that. I re-added the disappeared
default and now all is well again.

Also, while I was looking for the bug in SpecGen, I found a bunch
of TODOs that have already been done. Eliminate the comments for
these.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-24 09:27:20 -04:00
OpenShift Merge Robot c48a542013
Merge pull request #6733 from edsantiago/bats_help_extra_args
BATS tests: new too-many-arguments test
2020-06-24 09:27:07 -04:00
OpenShift Merge Robot b74238864f
Merge pull request #6739 from jwhonce/wip/connection
Fix ssh-agent support
2020-06-24 09:24:24 -04:00
OpenShift Merge Robot 3df30ef358
Merge pull request #6743 from giuseppe/specify-mappings-to-storage
libpod: specify mappings to the storage
2020-06-24 09:21:41 -04:00
OpenShift Merge Robot 0d26b8f24b
Merge pull request #6737 from maybe-sybr/maybe/doc/fix-volume-list-swagdoc
APIv2:doc: Fix swagger doc to refer to volumes
2020-06-24 05:34:05 -04:00
Giuseppe Scrivano 370195cf78
libpod: specify mappings to the storage
specify the mappings in the container configuration to the storage
when creating the container so that the correct mappings can be
configured.

Regression introduced with Podman 2.0.

Closes: https://github.com/containers/libpod/issues/6735

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-06-24 11:26:49 +02:00
maybe-sybr 3430ca4df0 APIv2: Return `StatusCreated` from volume creation
The swagdoc in `register_volumes.go` already correctly notes that a 201
should be returned upon success, so we only need to change the handler
to match the spec.

Signed-off-by: Matt Brindley <58414429+maybe-sybr@users.noreply.github.com>
2020-06-24 15:08:20 +10:00
maybe-sybr 5fbac502bd APIv2:fix: Remove `/json` from compat network EPs
Signed-off-by: Matt Brindley <58414429+maybe-sybr@users.noreply.github.com>
2020-06-24 12:20:49 +10:00
Jhon Honce 4e59fd77a8 Fix ssh-agent support
* An identity of "" implies ssh-agent and user/password to be used
* Fixed example

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-23 18:51:56 -07:00
maybe-sybr bfcfdfcb74 APIv2:doc: Fix swagger doc to refer to volumes
Signed-off-by: Matt Brindley <58414429+maybe-sybr@users.noreply.github.com>
2020-06-24 11:37:00 +10:00
OpenShift Merge Robot 5fe122bf52
Merge pull request #6706 from rhatdan/completions
Add podman network to bash command completions
2020-06-23 19:05:57 -04:00
OpenShift Merge Robot 1356f92afb
Merge pull request #6685 from mavit/autfile
Fix typo.
2020-06-23 19:03:01 -04:00
Ed Santiago 6864a5547a BATS tests: new too-many-arguments test
...plus a few others. And fixes to actual parsing.

If a command's usage message includes '...' in the
argument list, assume it can take unlimited arguments.
Nothing we can check.

For all others, though, the ALL-CAPS part on the
right-hand side of the usage message will define
an upper bound on the number of arguments accepted
by the command. So in our 'podman --help' test,
generate N+1 args and run that command. We expect
a 125 exit status and a suitably helpful error message.

Not all podman commands or subcommands were checking,
so I fixed that. And, fixed some broken usage messages
(all-caps FLAGS, and '[flags]' at the end of 'ARGS').
Add new checks to the help test to prevent those in
the future.

Plus a little refactoring/cleanup where necessary.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-06-23 14:17:48 -06:00
Qi Wang f586c006f8 Reformat inspect network settings
Reformat ports of inspect network settings to compatible with docker inspect. Close #5380

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-23 16:14:27 -04:00
OpenShift Merge Robot 81f4204e4e
Merge pull request #6728 from mheon/add_privileged_tests
Add tests for --privileged with other flags
2020-06-23 15:33:46 -04:00
Daniel J Walsh 0560a98e0e
Add podman network to bash command completions
network commands were not supported in command completions.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-23 15:31:08 -04:00
OpenShift Merge Robot 0d961a40ba
Merge pull request #6726 from edsantiago/bats
system tests: invoke with abs path to podman
2020-06-23 15:31:02 -04:00
Peter Oliver 4e85acf052 Fix typo in manpage for `podman auto update`.
Signed-off-by: Peter Oliver <git@mavit.org.uk>
2020-06-23 20:15:37 +01:00
OpenShift Merge Robot aa6881dd14
Merge pull request #6731 from baude/toolboxjson
Add JSON output field for ps
2020-06-23 14:14:43 -04:00
OpenShift Merge Robot 92af85fcc2
Merge pull request #6493 from jwhonce/wip/connection
V2 podman system connection
2020-06-23 14:01:36 -04:00
Matthew Heon 039eaccb5b Add tests for --privileged with other flags
With Podman v2.0, we broke (or thought we were going to break)
using `--privileged` with `--group-add` and `--security-opt`
(specifically using `--security-opt` for SELinux config).

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-06-23 12:46:32 -04:00
Brent Baude 9ec0e10484 Add JSON output field for ps
the toolbox team needs a field in our ps json that represents a human readable time.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-23 11:24:27 -05:00
Jhon Honce 7377e578a9 V2 podman system connection
* Implement command
* Refactor podman-remote to pull from containers.conf by default
* podman-remote defaults to --remote being true
* Write podman-system-connection.1.md

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-06-23 08:18:53 -07:00
Brent Baude b2c42a0993 wip
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-06-23 08:18:53 -07:00
OpenShift Merge Robot 73514b1465
Merge pull request #6722 from vrothberg/fix-6718
image load: no args required
2020-06-23 16:47:42 +02:00
Ed Santiago aa16a0aab1 system tests: invoke with abs path to podman
Reversion of one part of #6679: my handling of 'realpath'
would not work when $PODMAN is 'podman-remote --url etc'.
Trying to handle that case got unmaintainable; so instead
let's just force 'make {local,remote}system' to invoke
with a full PODMAN path. This breaks down if someone
runs the tests with a manual 'bats' invocation, but I
think I'm the only one who ever does that.

Since podman path will now be very long in the logs,
add code to logformatter to abbreviate it like we do
for the ginkgo logs.

And, one thing that has bugged me for a long time:
in the error logs, show a different prompt ('#' vs '$')
to distinguish root vs rootless. This should make it
much easier to see at-a-glance whether a log file
is root or not. Add tests for it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-06-23 08:10:57 -06:00
Valentin Rothberg 138d447eb4 image load: no args required
Disable the args requirement of `image load`.  Instead of requiring a
lower bound, we really need an upper one with at most 1 argument.
Extend the system tests to prevent future regressions.

Fixes: #6718
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-23 14:53:29 +02:00
OpenShift Merge Robot bbaba9fb86
Merge pull request #6679 from edsantiago/bats
system tests: new rm, build tests
2020-06-23 12:21:49 +02:00
OpenShift Merge Robot fc2c2ad174
Merge pull request #6712 from mheon/readd_userns_envvar
Re-add PODMAN_USERNS environment variable
2020-06-23 12:19:01 +02:00
OpenShift Merge Robot 3c51ff92ca
Merge pull request #6710 from vrothberg/fix-6413
libpod/containers/json: alias last -> limit
2020-06-23 12:16:15 +02:00
OpenShift Merge Robot 9e37fd43e4
Merge pull request #6625 from QiWang19/fd
Add --preservefds to podman run
2020-06-23 10:00:21 +02:00
OpenShift Merge Robot 22a7d60f18
Merge pull request #6715 from mheon/fix_security_exclusive
Fix conflicts between privileged and other flags
2020-06-23 00:18:52 +02:00
Ed Santiago d4504e6f53 system tests: new rm, build tests
- rm: confirm 'rm' and 'rm -f' on running container

 - build: shotgun test of workdir, cmd, env, labels

The new build test cd's to a temporary directory, which broke
test invocations using a relative path (./bin/podman). Added
code to detect relative paths and convert them to absolute.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-06-22 15:57:18 -06:00
Matthew Heon 13cfdb0742 Fix conflicts between privileged and other flags
The `--privileged` flag does not conflict with `--group-add`
(this one was breaking Toolbox) and does not conflict with most
parts of `--security-opt` (this was breaking Openstack).

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-22 16:08:09 -04:00
Matthew Heon f329e2ad67 Re-add PODMAN_USERNS environment variable
This was lost during the Podman 2.0 migration. Turns out to be a
very easy fix, fortunately - we want to use the environment var
if not explicitly overridden.

Fixes #6705

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-22 14:11:30 -04:00
OpenShift Merge Robot 22942e392d
Merge pull request #6709 from rhafer/go-version
Bump required go version to 1.13
2020-06-22 19:05:04 +02:00
OpenShift Merge Robot 11dd5f51b6
Merge pull request #6702 from jgallucci32/follow-logs-poll
Stop following logs using timers
2020-06-22 18:10:06 +02:00
OpenShift Merge Robot 78b205c8c9
Merge pull request #6700 from gavincampbell/typo-fix
Typo fix
2020-06-22 17:10:33 +02:00
OpenShift Merge Robot 277732b9bc
Merge pull request #6707 from lsm5/custom-GO_BUILD
Makefile: allow customizable GO_BUILD
2020-06-22 17:04:51 +02:00
Valentin Rothberg 2abcd4f1de libpod/containers/json: alias last -> limit
Support both `last` and `limit` for in the containers listing endpoint.
We intended to use `limit` which is also mentioned in the docs, but the
implementation ended up using `last` as the http parameter; likely being
caused by the CLI using `--last`.  To avoid any regression, we decided
for supporting both and aliasing `last`.

Fixes: #6413
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-22 16:55:48 +02:00
Ralf Haferkamp f52dd4fb1c Bump required go version to 1.13
Recent versions of libpod use features from github.com/pkg/errors
that are only available when building with go 1.13 or newer.

Closes #6708

Signed-off-by: Ralf Haferkamp <rhafer@suse.com>
2020-06-22 16:53:33 +02:00
Lokesh Mandvekar 78bd0e0a63 Makefile: allow customizable GO_BUILD
This will let me use a customizable GO_BUILD so that I can run build
targets for deb packages

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-06-22 09:59:30 -04:00