Commit Graph

7612 Commits

Author SHA1 Message Date
Matthew Heon f7c3cfde77 Add small fixes for 'podman run' from diffing inspect
To try and identify differences between Podman v1.9 and master,
I ran a series of `podman run` commands with various flags
through each, then inspecting the resulting containers and diffed
the inspect JSON between each. This identified a number of issues
which are fixed in this PR.

In order of discovery:
- Podman v2 gave short names for images, where Podman v1 gave the
  fully-qualified name. Simple enough fix (get image tags and use
  the first one if they're available)
- The --restart flag was not being parsed correctly when a number
  of retries was specified. Parsing has been corrected.
- The -m flag was not setting the swap limit (simple fix to set
  swap in that case if it's not explicitly set by the user)
- The --cpus flag was completely nonfunctional (wired in its
  logic)

Tests have been added for all of these to catch future
regressions.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-05 20:21:01 -04:00
OpenShift Merge Robot fb6eca50ba
Merge pull request #6088 from edsantiago/bats_check_usage
BATS help test: check usage string
2020-05-05 17:32:25 +02:00
OpenShift Merge Robot 9db97dbab8
Merge pull request #6080 from baude/v2stats
v2 podman stats
2020-05-05 17:29:56 +02:00
OpenShift Merge Robot e6235ef8f1
Merge pull request #6076 from vrothberg/rmi-v2.2
image removal: refactor part 2
2020-05-05 17:25:04 +02:00
OpenShift Merge Robot 4a1331d0af
Merge pull request #6077 from rhatdan/v2
Fix errors found when comparing podman v1 --help versus V2
2020-05-05 15:57:08 +02:00
baude b5a235df90 v2 podman stats
Signed-off-by: baude <bbaude@redhat.com>
2020-05-05 08:46:51 -05:00
OpenShift Merge Robot c313eec620
Merge pull request #6079 from mheon/add_expose
Rework port parsing to support --expose and -P
2020-05-05 15:21:37 +02:00
Ed Santiago 29d39e35e4 BATS help test: check usage string
Now that we've agreed that usage messages should match
what the user typed, confirm it. IOW 'podman foo --help'
should not issue a usage message for 'podman container foo'.

Fix one broken instance, 'unpause'.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-05-05 07:19:58 -06:00
OpenShift Merge Robot e1be837a4f
Merge pull request #6082 from TomSweeneyRedHat/dev/tsweeney/trub1
[CI:DOC] Add linger to troubleshooting
2020-05-05 10:23:30 +02:00
Matthew Heon 7ac3d906b5 Rework port parsing to support --expose and -P
As part of this, make a major change to the type we use to
represent port mappings in SpecGen (from using existing OCICNI
structs to using our own custom one). This struct has the
advantage of supporting ranges, massively reducing traffic over
the wire for Podman commands using them (for example, the
`podman run -p 5000-6000` command will now send only one struct
instead of 1000). This struct also allows us to easily validate
which ports are in use, and which are not, which is necessary for
--expose.

Once we have parsed the ports from the new struct, we can produce
an accurate map including all currently requested ports, and use
that to determine what ports need to be exposed (some requested
exposed ports may already be included in a mapping from --publish
and will be ignored) and what open ports on the host we can map
them to.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-05-04 20:57:27 -04:00
TomSweeneyRedHat fa3986125e [CI:DOC] Add linger to troubleshooting
Adding a troubleshooting note about how to configure systemd
to linger for detached containers in rootless mode.  This came
up in an email stream on the Podman mailing list today and
answered by @mheon

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-05-04 19:36:24 -04:00
Daniel J Walsh 6ed3b8841f
Fix errors found when comparing podman v1 --help versus V2
Mainly add missing commands to podman image, podman containers, podman system

Also fix some informations messages and descriptions.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-04 14:16:34 -04:00
OpenShift Merge Robot 01aad516e0
Merge pull request #6069 from pr0PM/patch-1
Updated the broken links for the docs.
2020-05-04 18:50:25 +02:00
pr0PM 050f71977e Updated the broken links for the docs.
All the links updated here were pointing to ```./docs/*``` and now have been updated to ```./docs/source/markdown/*```.

Signed-off-by: pr0PM <pmprateek88@gmail.com>
2020-05-04 21:43:36 +05:30
OpenShift Merge Robot a8dc0fceb9
Merge pull request #6074 from containers/dependabot/go_modules/github.com/sirupsen/logrus-1.6.0
Bump github.com/sirupsen/logrus from 1.5.0 to 1.6.0
2020-05-04 16:06:01 +02:00
Valentin Rothberg 7f97896c59 image removal: refactor part 2
Continue the refactoring of image removal.  I didn't manage to break all
the following changes into smaller and easier to digest commits due to
time constraints:

 * Return an error slice instead of a single error. Use multierror only
   in the client/frontend.  Reflect that in the types.

 * Use the batch image removal in the client while preserving the more
   rest-idiomatic single-image removal endpoint.

 * Add a new handler for the single-image removal endpoint to make it
   share the same code as the batch endpoint.

 * Expose bindings for the single and batch endpoints, so we can
   properly test them.

 * Add several convenience functions for error handling to
   pkg/errorhandling.

 * Set the correct error type in libpod to set the exit code to 2 when
   one or more containers are using an image.

 * Massage the bindings tests a bit and tackle compilation errors.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-04 16:01:45 +02:00
dependabot-preview[bot] 2e79d60d3e
Bump github.com/sirupsen/logrus from 1.5.0 to 1.6.0
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/sirupsen/logrus/releases)
- [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sirupsen/logrus/compare/v1.5.0...v1.6.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-04 08:21:35 -04:00
OpenShift Merge Robot 51d0be4204
Merge pull request #6051 from rhatdan/containers.conf
Fixes for test/e2e/containers_conf_test.go
2020-05-04 11:08:43 +02:00
OpenShift Merge Robot 7b941462d4
Merge pull request #6066 from TomSweeneyRedHat/dev/tsweeney/fixquayio
[CI:DOC]Use full repo name in podmanimage Dockerfiles
2020-05-03 14:24:41 +02:00
TomSweeneyRedHat 36d36ec2a4 [CI:DOC]Use full repo name in podmanimage Dockerfiles
In the Buildah images, we had a problem where the testing image
was installed with an older version of Buildah than the stable
image.  This was apparently due to quay.io using Docker and Dockerhub
which has a version of Fedora that did not let testing
version of Buildah to be installed as it should have been.

This change fully specifies the name of the fedora image to
use.  This has not been a problem in Podman, but I'm carrying
this change here to avoid future problems.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-05-01 17:54:33 -04:00
OpenShift Merge Robot 0fd8242f91
Merge pull request #6058 from rhatdan/coverity
Fix errors found in coverity scan
2020-05-01 21:32:22 +02:00
OpenShift Merge Robot 54fa377faf
Merge pull request #6061 from QiWang19/getlogin
check --get-login when login
2020-05-01 21:29:46 +02:00
OpenShift Merge Robot bffd3f5134
Merge pull request #6060 from sujil02/systemprune-v2
And system prune feature for v2.
2020-05-01 21:08:50 +02:00
Daniel J Walsh 7d37f4bbfe
Fix errors found in coverity scan
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-01 15:00:33 -04:00
Daniel J Walsh 1218d70915
Remove skip on containers.conf tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-01 15:00:33 -04:00
Daniel J Walsh 97fcbfcbec
cgroupsns was not following containers.conf
Implement ParseCgroupsNamespace to handle defaults.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-01 15:00:33 -04:00
Daniel J Walsh 4a2765c498
Properly handle default capabilities listed in containers.conf
If user/admin specifies a different list of default capabilties
we need to honor these.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-01 15:00:26 -04:00
Daniel J Walsh 730fbc7628
Properly handle containers.conf devices
We need to add the default devices listed in containers.conf

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-01 15:00:26 -04:00
OpenShift Merge Robot 95b9b72c0c
Merge pull request #6062 from jwhonce/wip/docs
[CI:DOC] Bring README.md up to date
2020-05-01 20:59:05 +02:00
Jhon Honce b22a39b6b1 [CI:DOCS] Bring README.md up to date
* Add notes on helper functions
* Update example

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-05-01 11:22:39 -07:00
Sujil02 b94862171b And system prune feature for v2.
Adds podman system prune for v2.
Refactoring for code reuse from pods containers images and volume prune.
Adds and enables testcases to support the added feature.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-05-01 13:57:16 -04:00
OpenShift Merge Robot a451048efc
Merge pull request #6059 from QiWang19/search-limit
search --limit compatible with docker
2020-05-01 19:26:54 +02:00
Daniel J Walsh 8173e83054
Fix errors found in coverity scan
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-01 13:26:50 -04:00
OpenShift Merge Robot 226e0da6fe
Merge pull request #6057 from baude/v2networking
v2networking enable commands
2020-05-01 18:27:16 +02:00
Qi Wang 1eba4fbc43 check --get-login when login
Check --get-login is set in podman since it is not shared option from c/common and does not valid by the package.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-01 11:27:22 -04:00
Qi Wang ef603de8ec search --limit compatible with docker
Check --limit range and update --limit manpage explanation.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-01 11:20:19 -04:00
baude 98e71583a4 add provided cni networks to spec gen
enable final integration tests for networking.

Signed-off-by: baude <bbaude@redhat.com>
2020-05-01 09:20:52 -05:00
OpenShift Merge Robot 49107a5a2e
Merge pull request #6004 from rhatdan/ulimits
Set up ulimits for rootless containers.
2020-05-01 15:58:24 +02:00
OpenShift Merge Robot 1230499e45
Merge pull request #6016 from giuseppe/fix-create
v2, podman: fix create and entrypoint tests
2020-05-01 15:32:00 +02:00
OpenShift Merge Robot 2f3762eb91
Merge pull request #6044 from cevich/update_f32
Cirrus: Update to Fedora 32 proper
2020-05-01 02:51:12 +02:00
OpenShift Merge Robot 6803e72bf8
Merge pull request #6055 from baude/v2args
fix commands without input
2020-04-30 22:59:09 +02:00
baude 52371057cd fix commands without input
in cases where commands require input and we dont provide it, we often would segv.  This can be attributed in many cases to the subcommand not picked up the cobra Args attribute or neither had them.

Signed-off-by: baude <bbaude@redhat.com>
2020-04-30 15:10:49 -05:00
Ed Santiago 91a42fefcb System tests: help messages: check required-arg
If a usage message is of the form '... [flags] ARGNAME',
where ARGNAME is all-caps and not in brackets, it must
be a required argument. Try running podman subcommand
without ARGNAME, and make sure that podman bails out
with an informative message. (Since this message is
freeform in each subcommand, not Cobra-generated,
we have a lot of possible variations to check for).

Fix podman login/logout Use messages to indicate that
REGISTRY is now optional (as of #5233).

This test has actually been in place for over a year but
due to a typo on my part -- a missing space -- it was
not being run. "For want of a space, much testing was lost".

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-30 14:55:10 -05:00
baude e88a418528 v2networking enable commands
Enable the networking commands for v2.

Signed-off-by: baude <bbaude@redhat.com>
2020-04-30 14:53:54 -05:00
OpenShift Merge Robot c31bf2e976
Merge pull request #6056 from jwhonce/wip/rootless
V2 Commands that require ParentNS (rootful) are report error
2020-04-30 21:48:07 +02:00
OpenShift Merge Robot 8c9e5fdaf0
Merge pull request #5861 from containers/dependabot/go_modules/github.com/containers/psgo-1.5.0
Bump github.com/containers/psgo from 1.4.0 to 1.5.0
2020-04-30 21:33:36 +02:00
Jhon Honce 399939a3de V2 Commands that require ParentNS (rootful) are report error
* Updated unmount to require ParentNS

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-30 12:14:57 -07:00
OpenShift Merge Robot 9467694a63
Merge pull request #6052 from sujil02/enable-prune-test
Enable prune integration test. Fixes container prune
2020-04-30 21:06:11 +02:00
OpenShift Merge Robot 6900517f10
Merge pull request #6046 from jwhonce/jira/822
V2 enable ps tests
2020-04-30 20:01:55 +02:00
Chris Evich 50f067bc42
Cirrus: Utilize new cache images
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-04-30 13:21:03 -04:00