Commit graph

9983 commits

Author SHA1 Message Date
OpenShift Merge Robot 6c2503ca04
Merge pull request #8272 from rhatdan/logs
Test podman-remote logs works the same as podman logs
2020-11-12 12:00:38 +01:00
OpenShift Merge Robot 53c60a68db
Merge pull request #8300 from TomSweeneyRedHat/dev/tsweeney/addmain
Add podman(1) to the list of man pages on docs.podman.io
2020-11-12 11:54:16 +01:00
dependabot-preview[bot] b1b6b88f3b
Bump github.com/rootless-containers/rootlesskit from 0.11.0 to 0.11.1
Bumps [github.com/rootless-containers/rootlesskit](https://github.com/rootless-containers/rootlesskit) from 0.11.0 to 0.11.1.
- [Release notes](https://github.com/rootless-containers/rootlesskit/releases)
- [Commits](https://github.com/rootless-containers/rootlesskit/compare/v0.11.0...v0.11.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-12 05:51:44 -05:00
Paul Holzinger ae3816614d Install the new shell completion logic
Add a new make target (completion) to generate the shell
completion scripts. This will generate the scripts for bash,
zsh and fish for both podman and podman-remote with `podman completion`.
The scripts are put into the completions directory and can be
installed system wide with `sudo make install.completions`.

This commit replaces the current handwritten scripts for bash and zsh.

The `validate.completion` target has been adjusted to make sure nobody
edits these scripts directly.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 11:40:29 +01:00
Paul Holzinger b5d1d89a37 Add shell completion with cobra
Allow automatic generation for shell completion scripts
with the internal cobra functions (requires v1.0.0+).

This should replace the handwritten completion scripts
and even adds support for fish. With this approach it is
less likley that completions and code are out of sync.

We can now create the scripts with
- podman completion bash
- podman completion zsh
- podman completion fish

To test the completion run:
source <(podman completion bash)

The same works for podman-remote and podman --remote and
it will complete your remote containers/images with
the correct endpoints values from --url/--connection.

The completion logic is written in go and provided by the
cobra library. The completion functions lives in
`cmd/podman/completion/completion.go`.

The unit test at cmd/podman/shell_completion_test.go checks
if each command and flag has an autocompletion function set.
This prevents that commands and flags have no shell completion set.

This commit does not replace the current autocompletion scripts.

Closes #6440

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 11:38:31 +01:00
Paul Holzinger df4bf5c584 Vendor in some cobra PRs to improve the completion experience.
This is only temporary until the cobra following PRs are merged:

- PR#1258 Custom completion handle multiple shorhand flags together
- PR#1249 Fix fish handling of "ShellCompDirectiveNoSpace" and file completion
- PR#1213 Fix zsh completion handling of nospace and file completion
- PR#1146 Bash completion V2 with completion descriptions

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 11:32:03 +01:00
Matthew Heon 8d56eb5342 Add support for network connect / disconnect to DB
Convert the existing network aliases set/remove code to network
connect and disconnect. We can no longer modify aliases for an
existing network, but we can add and remove entire networks. As
part of this, we need to add a new function to retrieve current
aliases the container is connected to (we had a table for this
as of the first aliases PR, but it was not externally exposed).

At the same time, remove all deconflicting logic for aliases.
Docker does absolutely no checks of this nature, and allows two
containers to have the same aliases, aliases that conflict with
container names, etc - it's just left to DNS to return all the
IP addresses, and presumably we round-robin from there? Most
tests for the existing code had to be removed because of this.

Convert all uses of the old container config.Networks field,
which previously included all networks in the container, to use
the new DB table. This ensures we actually get an up-to-date list
of in-use networks. Also, add network aliases to the output of
`podman inspect`.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-11-11 16:37:54 -05:00
Matthew Heon 0f637e09da Ensure we do not double-lock the same volume in create
When making containers, we want to lock all named volumes we are
adding the container to, to ensure they aren't removed from under
us while we are working. Unfortunately, this code did not account
for a container having the same volume mounted in multiple places
so it could deadlock. Add a map to ensure that we don't lock the
same name more than once to resolve this.

Fixes #8221

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-11-11 16:06:03 -05:00
Daniel J Walsh f3648b4ae8
Cleanup error reporting
The error message reported is overlay complicated and the added test does not
really help the user.

Currently the error looks like:

podman run -p 80:80 fedora echo hello
Error: failed to expose ports via rootlessport: "cannot expose privileged port 80, you might need to add "net.ipv4.ip_unprivileged_port_start=0" (currently 1024) to /etc/sysctl.conf, or choose a larger port number (>= 1024): listen tcp 0.0.0.0:80: bind: permission denied\n"

After this change

./bin/podman run -p 80:80 fedora echo hello
Error: cannot expose privileged port 80, you might need to add "net.ipv4.ip_unprivileged_port_start=0" (currently 1024) to /etc/sysctl.conf, or choose a larger port number (>= 1024): listen tcp 0.0.0.0:80: bind: permission denied

Control chars have been eliminated.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-11 13:11:15 -05:00
OpenShift Merge Robot ea75312895
Merge pull request #8306 from edsantiago/ci_update_vms
Cirrus: update VMs
2020-11-11 18:57:02 +01:00
Ed Santiago 92e31a2085 Cirrus: update VMs
Reason: include perl-FindBin RPM in f33 VM, needed for
hack/xref-helpmsgs-manpages

Ref: https://github.com/containers/automation_images/pull/39

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-11-11 08:56:08 -07:00
OpenShift Merge Robot 12dbc1ff7d
Merge pull request #8299 from edsantiago/ci_reenable_manpage_xref
[CI:DOCS] Restore man page cross-checker
2020-11-11 16:50:47 +01:00
Ed Santiago b0601cb34a [CI:DOCS] Restore man page cross-checker
Somewhere in the CIv2 migration we lost the man page vs --help
cross-checker. Add it back, by adding it into the man-page-check
Makefile target; this is part of 'make validate', which is run
in CI even on CI:DOCS PRs.

As happens when CI doesn't run, things broke. Man pages got out
of sync with --help. This PR:

 1) Fixes hack/xref-helpmsgs-manpages to deal with the new
    "Options" (instead of "Flags") form of podman help. #8034
    did part of that, but one of my review comments was
    accidentally left out.

 2) Fixes hack/xref-helpmsgs-manpages to deal with the new
    option syntax in man pages, post- #8292, in which each
    option is preceded by four hashes so as to make them
    HTML <h4> elements with named anchors.

 3) Fixes man pages that #8292 accidentally missed.

 4) Adds man page entries for two flags that got added
    to podman but not documented (pod create --network-alias,
    play kube --log-driver)

Fixes: #8296

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-11-11 08:31:30 -07:00
OpenShift Merge Robot 1952420e88
Merge pull request #8297 from cevich/restore_docs_testing
Cirrus: Run validation tests in CI:DOCS mode
2020-11-11 15:32:48 +01:00
OpenShift Merge Robot e443c01437
Merge pull request #8295 from baude/issue8294
Set default network driver for APIv2 networks
2020-11-11 15:31:03 +01:00
Chris Evich 3e7100b44b
Cirrus: Run validation tests in CI:DOCS mode
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-11-11 09:14:41 -05:00
TomSweeneyRedHat 4c422cbc34 Add podman(1) to the list of man pages on docs.podman.io
As the title says.

Addresses: #7219

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-11-10 19:36:18 -05:00
baude b917b9925c Set default network driver for APIv2 networks
Recent changes in networking require that the cni network driver be set.
If the user provides no driver, we set the driver to the
defaultnetworkdriver which currently is "bridge".

Fixes: #8294

Signed-off-by: baude <bbaude@redhat.com>
2020-11-10 14:00:54 -06:00
OpenShift Merge Robot bb07b8c9f1
Merge pull request #8252 from baude/playkubetospecgen
migrate play kube to spec gen
2020-11-10 19:43:47 +01:00
Daniel J Walsh 0fc3c0d91b
Add tests to make sure podman-remote logs works correctly.
Fixes: https://github.com/containers/podman/issues/7942

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-10 13:40:56 -05:00
OpenShift Merge Robot 9e71fc4552
Merge pull request #8287 from containers/dependabot/go_modules/github.com/containers/common-0.27.0
Bump github.com/containers/common from 0.26.3 to 0.27.0
2020-11-10 19:40:23 +01:00
OpenShift Merge Robot ca672373b5
Merge pull request #8292 from Luap99/doc-anchors
[CI:DOCS] Add anchors for flag names on docs.podman.io
2020-11-10 19:12:58 +01:00
OpenShift Merge Robot ce2ac7d2d2
Merge pull request #8251 from baude/networkaliases
network aliases for container creation
2020-11-10 19:10:59 +01:00
Paul Holzinger 52a8694705 Add anchors for flag names on docs.podman.io
Change the docs markdown so that flag names will be h4 headers.
Sphinx will automatically add anchors to headers. Add css to
make sure the flag names are not to big compared to the text.

The man pages also still renders fine but it looks a bit different.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-10 15:27:08 +01:00
OpenShift Merge Robot da01191aa3
Merge pull request #8278 from rhatdan/man1
[CI:DOCS] Add example of fuse-overlay to podman system reset
2020-11-10 14:25:44 +00:00
baude 72ec8b0aa2 migrate play kube to spec gen
we need to migrate play kube away from using the old container creation
method.  the new approach is specgen and this aligns play kube with
container creation in the rest of podman.

Signed-off-by: baude <bbaude@redhat.com>
2020-11-10 07:55:24 -06:00
OpenShift Merge Robot 20b26b5210
Merge pull request #8143 from aojea/dual
enable ipv6 networks
2020-11-10 13:50:43 +00:00
OpenShift Merge Robot da95fb4226
Merge pull request #8270 from andylibrian/log-driver-option-for-play-kube
Add --log-driver to play kube
2020-11-10 12:29:19 +00:00
OpenShift Merge Robot c20970f2b4
Merge pull request #8286 from baude/dnsnamecleanup
make network name uniq for dnsname tests
2020-11-10 12:24:28 +00:00
Daniel J Walsh 0ba2261528
Add example of fuse-overlay to podman system reset
A fairly common mistake users are hitting is running rootless podman without
installing fuse-overlay.  Then they want to reset storage.  Sometimes they
modify storage.conf first and `podman system reset` fails.

This PR attempts to explain how to convert properly.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-10 07:24:13 -05:00
dependabot-preview[bot] 24ec03a5f1
Bump github.com/containers/common from 0.26.3 to 0.27.0
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.26.3 to 0.27.0.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](https://github.com/containers/common/compare/v0.26.3...v0.27.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-10 07:21:13 -05:00
Antonio Ojea aabf28a168 skip ipv6 e2e tests on rootless
The IPv6 e2e tests on the CI for rootles mode fails because
it needs the ip6tables modules loaded.

Example error:

stdout="", stderr="failed to list chains: running [/sbin/ip6tables -t nat -S --wait]: exit status 3: modprobe: can't change directory to '/lib/modules': No such file or directory\nip6tables v1.8.4 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)\nPerhaps ip6tables or your kernel needs to be upgraded.\n\n"

Signed-off-by: Antonio Ojea <aojea@redhat.com>
2020-11-10 11:04:02 +01:00
Antonio Ojea 98d770747e add e2e test for network with same subnet
add e2e test that checks that is not possible to create
different networks with the same subnet, in IPv6 neither
in IPv4

Signed-off-by: Antonio Ojea <aojea@redhat.com>
2020-11-10 11:03:56 +01:00
Antonio Ojea e7a72d72fd enable ipv6 network configuration options
enable the ipv6 flag in podman network to be able to create
dual-stack networks for containers.

This is required to be compatible with docker, where --ipv6
really means dual stack.

podman, unlike docker, support IPv6 only containers since
07e3f1bba9.

Signed-off-by: Antonio Ojea <aojea@redhat.com>
2020-11-10 08:34:52 +01:00
OpenShift Merge Robot a64c6dc90a
Merge pull request #8284 from edsantiago/bats
system tests: skip journald tests on RHEL8
2020-11-10 01:38:46 +00:00
baude ddadc99e99 make network name uniq for dnsname tests
ed identified that the dnsname integration test does not use a unique
name and therefore cannot be cleaned up.  this was made worse by a
improper defer statement to remove the network should the test fail.

Signed-off-by: baude <bbaude@redhat.com>
2020-11-09 16:35:12 -06:00
baude b7b5b6f8e3 network aliases for container creation
podman can now support adding network aliases when running containers
(--network-alias).  It requires an updated dnsname plugin as well as an
updated ocicni to work properly.

Signed-off-by: baude <bbaude@redhat.com>
2020-11-09 15:08:58 -06:00
Ed Santiago c62c64856e system tests: skip journald tests on RHEL8
(actually, on any system exhibiting the symptom wherein
journalctl fails due to insufficient permissions, which
for all practical purposes means only RHEL8)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-11-09 13:44:44 -07:00
OpenShift Merge Robot 81c973c51f
Merge pull request #8256 from rhatdan/man
[CI:DOCS] Update podman build man page to match buildah bud man page
2020-11-09 20:42:19 +00:00
Daniel J Walsh c12065401f
Update podman build man page to match buildah bud man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-11-09 15:10:20 -05:00
OpenShift Merge Robot 716f70b5c5
Merge pull request #8236 from jwhonce/jira/run-976
Update CI tests to run python docker library against API
2020-11-09 20:08:29 +00:00
OpenShift Merge Robot 110a1d8f25
Merge pull request #8276 from Luap99/search-json
Add support for podman search --format json
2020-11-09 20:01:31 +00:00
OpenShift Merge Robot 1491b20f08
Merge pull request #8282 from jwhonce/issues/7942
Stop binding layer from changing line endings
2020-11-09 19:59:51 +00:00
OpenShift Merge Robot 8f33751b57
Merge pull request #8283 from kierdavis/docs
[CI:DOCS] man pages: add an example, tweak formatting
2020-11-09 19:58:09 +00:00
Chris Evich f44af20561
Cirrus: Detailed CPU/Memory/Time runner.sh stats
On several occasions, there have been questions about CPU/Memory/IO
trends in testing over time. Start collecting this data for all jobs,
using a common/stable format so that trending analysis can be performed
within/across multiple Cirrus-CI builds. This PR doesn't add any related
tooling, it simply arranges for the collection of the data.

Stats generation is done at the orchestration level to guarantee they
reflect everything happening inside `runner.sh`.  For example, the
container-based tests re-exec `runner.sh` inside a container, but
we're only interested in the top-level stats.

Update all tasks to include collection of the stats file.
Unfortunately, due to the way the Cirrus-CI YAML parser works,
it is *not* possible to alias the artifacts collection more clearly,
for example:

```yaml
    always:
        <<: *runner_stats
        <<: *logs_artifacts
```

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-11-09 14:32:39 -05:00
Kier Davis 71fe822434 podman-pull.1.md: add example for pulling an image by hash
Signed-off-by: Kier Davis <me@kierdavis.com>
2020-11-09 13:18:38 -06:00
Kier Davis c20a70f8c3 podman-import.1.md: fix paragraph formatting
Signed-off-by: Kier Davis <me@kierdavis.com>
2020-11-09 13:18:38 -06:00
Kier Davis f29cda6d92 podman-import.1.md: fix shell syntax
Signed-off-by: Kier Davis <me@kierdavis.com>
2020-11-09 13:18:38 -06:00
Jhon Honce 2d50ec6996 Update CI tests to run python docker library against API
* Update reference to docker-py to docker to reflect change in library
  name
* Update tests to create storage sandbox
* Enable all tests that endpoints support
* Refactor containers/{id}/rename to return 404 not 500
* Refactor tests to use quay.io vs. docker.io

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-11-09 10:45:54 -07:00
Jhon Honce a722ba6478 Stop binding layer from changing line endings
The binding layer attempted to help the CLI, which just made things
worse.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-11-09 10:37:18 -07:00