10478 Commits

Author SHA1 Message Date
99ac30a882 Merge pull request #8690 from zhangguanzhang/apiv2-wrong-ImgName
Fix Wrong img name used when creating a container from an image which had multi names
2020-12-11 10:20:16 -05:00
335c59e7dc Merge pull request #8691 from Luap99/network-compat
Fix some network compat api problems
2020-12-11 10:04:28 -05:00
f711f5a68d podman: drop checking valid rootless UID
do not check whether the specified ID is valid in the user namespace.

crun handles this case[1], so the check in Podman prevents to get to
the OCI runtime at all.

$ podman run --user 10:0 --uidmap 0:0:1 --rm -ti fedora:33 sh -c 'id; cat /proc/self/uid_map'
uid=10(10) gid=0(root) groups=0(root),65534(nobody)
        10          0          1

[1] https://github.com/containers/crun/pull/556

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-11 15:43:33 +01:00
2e0a9c453b Cleanup CNI Networks on reboot
CNI sometimes leaves Network information in /var/lib/cni/networks
when the system crashes or containers do not shut down properly.

This PR will cleanup these left over files, so that container engines
will get a clean enviroment when the system reboots.

Related to: https://github.com/containers/podman/issues/3759

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-11 09:18:38 -05:00
2a35387e9e Fix some network compat api problems
Network create could panic when used with a json body like this:
`{"Name":"net","IPAM":{"Config":[]}}`

The network scope for list and inspect should not be empty. It can
be swarm, global or local. We only support local networks so
hardcode this field to local.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-12-11 14:16:05 +01:00
fb25f737e5 Fix Wrong image tag is used when creating a container from an image with multiple tags
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-12-11 20:02:41 +08:00
098e0a7885 Handle --rm when starting a container
podman start should follow the same behaviour as podman run when removing a
container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-11 06:07:14 -05:00
dd954781e6 Merge pull request #8633 from baude/bindings3
Bindings refactor
2020-12-11 05:36:08 -05:00
7dd1da3787 Refine public key usage when remote
* Move all public key handling into one AuthMethod. Prioritize ssh-agent
  keys over identity files.
* Cache server connection when tunneling, saves one RoundTrip on ssh
  handshake

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-12-10 15:32:37 -07:00
ba545c49a2 podman logs honor stderr correctly
Make the ContainerLogsOptions support two io.Writers,
one for stdout and the other for stderr. The logline already
includes the information to which Writer it has to be written.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-12-10 22:24:43 +01:00
ead8b5be0f Bindings refactor
this is step one of refactoring our golang binaries.  we will no be
using structs to pass optional options.  required options will still
arguments to the binding itself.

the structs then have a generator to create helper functions which
should then be added to the git repo.

Signed-off-by: baude <bbaude@redhat.com>
2020-12-10 12:53:08 -06:00
6823a5d6cc Merge pull request #8664 from rhatdan/prune
Add --filter to podman system prune
2020-12-10 13:32:41 -05:00
46183cf873 Ignore containers.conf sysctls when sharing namespaces
The existing code prevents containers.conf default sysctls from
being added if the container uses a host namespace. This patch
expands that to not just host namespaces, but also *shared*
namespaces - so we never modify another container's (or a pod's)
namespaces without being explicitly directed to do so by the
user.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-12-10 11:43:59 -05:00
2bb149034b Merge pull request #8681 from Luap99/fix-image-exists-panic
Fix panic in libpod images exists endpoint
2020-12-10 10:16:41 -05:00
3fa61f0004 Fix panic in libpod images exists endpoint
The libpod images exists endpoint panics when called with
a non existing image and therefore returns 500 as status
code instead of the expected 404.

A test is added to ensure it is working.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-12-10 14:35:17 +01:00
deb00425c2 Merge pull request #8678 from containers/dependabot/go_modules/github.com/containernetworking/plugins-0.9.0
Bump github.com/containernetworking/plugins from 0.8.7 to 0.9.0
2020-12-10 07:38:02 -05:00
eaa19a1c10 Merge pull request #8641 from umohnani8/play
Do not pull if image domain is localhost
2020-12-10 05:20:48 -05:00
eb9e774304 Bump github.com/containernetworking/plugins from 0.8.7 to 0.9.0
Bumps [github.com/containernetworking/plugins](https://github.com/containernetworking/plugins) from 0.8.7 to 0.9.0.
- [Release notes](https://github.com/containernetworking/plugins/releases)
- [Commits](https://github.com/containernetworking/plugins/compare/v0.8.7...v0.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-10 05:15:22 -05:00
9216be2008 Merge pull request #8636 from containers/dependabot/go_modules/github.com/containers/storage-1.24.3
Bump github.com/containers/storage from 1.24.1 to 1.24.3
2020-12-09 17:28:18 -05:00
eb053df784 Merge pull request #8670 from rhatdan/caps
Properly handle --cap-add all when running with a --user flag
2020-12-09 16:04:45 -05:00
15cdcdca76 Add --filter to podman system prune
Also document the allowable filters in podman system prune, podman image prune
and podman container prune.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 16:01:13 -05:00
c20bd35589 Fix storage.conf to define driver in the VM
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 15:09:39 -05:00
2605dd82bf Bump github.com/containers/storage from 1.24.1 to 1.24.3
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.24.1 to 1.24.3.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.24.1...v1.24.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 15:09:38 -05:00
059c2ee739 Merge pull request #8669 from giuseppe/unmask-also-cover-ro-paths
security: honor systempaths=unconfined for ro paths
2020-12-09 15:04:41 -05:00
4511cb3852 Merge pull request #8659 from containers/dependabot/go_modules/github.com/opencontainers/selinux-1.7.0
Bump github.com/opencontainers/selinux from 1.6.0 to 1.7.0
2020-12-09 15:02:48 -05:00
43567c6539 Merge pull request #8657 from containers/dependabot/go_modules/github.com/onsi/gomega-1.10.4
Bump github.com/onsi/gomega from 1.10.3 to 1.10.4
2020-12-09 15:00:37 -05:00
6db3e9bfeb Merge pull request #8653 from rhatdan/buildah
Honor the --layers flag
2020-12-09 14:58:28 -05:00
da062b5bd0 Merge pull request #8635 from Luap99/shell-completion-test
Add system test for shell completion
2020-12-09 14:47:05 -05:00
1ace9e3ba6 Properly handle --cap-add all when running with a --user flag
Handle the ALL Flag when running with an account as a user.

Currently we throw an error when the user specifies

podman run --user bin --cap-add all fedora echo hello

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 14:21:16 -05:00
176be90e0a security: honor systempaths=unconfined for ro paths
we must honor systempaths=unconfined also for read-only paths, as
Docker does:

proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-12-09 19:26:23 +01:00
2870a0b0a6 Add system test for shell completion
There exists a unit test to ensure that shell completion functions are
defined. However there was no check about the quality of the provided
shell completions. Lets change that.

The idea is to create a general test that makes sure we are suggesting
containers,pods,images... for the correct commands. This works by
reading the command use line and checking for each arg if we provide
the correct suggestions for this arg.

It includes the following tests:
- flag suggestions if [options] is set
- container, pod, image, network, volume, registry completion
- path completion for the appropriate arg KEYWORDS (`PATH`,`CONTEXT`,etc.)
- no completion if there are no args
- completion for more than one arg if it ends with `...]`

The test does not cover completion values for flags and not every arg KEYWORD
is supported. This is still a huge improvement and covers most use cases.

This test spotted several inconsistencies between the completion and the
command use line. All of them have been adjusted to make the test pass.

The biggest advantage is that the completions always match the latest
command changes. So if someone changes the arguments for a command this
ensures that the completions must be adjusted.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-12-09 19:13:28 +01:00
9abbe0728c Merge pull request #8663 from vrothberg/run-950
archive endpoint massaging
2020-12-09 10:39:48 -05:00
3cd143fc58 Merge pull request #8611 from vrothberg/short-names
enable short-name aliasing
2020-12-09 10:15:55 -05:00
49d11b53e1 Merge pull request #8661 from rhatdan/codespell
Fix spelling mistakes
2020-12-09 09:52:20 -05:00
b875c5c27c Merge pull request #8599 from rhatdan/prune
Repeat system pruning until there is nothing removed
2020-12-09 08:46:44 -05:00
ae7f601649 Merge pull request #8654 from cruwe/cjr/bugfix-8608-take-envs-from-img
make podman play use ENVs from image
2020-12-09 08:44:47 -05:00
228df27b54 Bump github.com/onsi/gomega from 1.10.3 to 1.10.4
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.10.3 to 1.10.4.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.10.3...v1.10.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 08:37:22 -05:00
0154f9e9b3 Honor the --layers flag
Currently the --layers flag set by the user is ignored, and only the BUILDAH_LAYERS
environment variable being set is observed.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 08:31:36 -05:00
247260081a Merge pull request #8656 from containers/dependabot/go_modules/k8s.io/apimachinery-0.20.0
Bump k8s.io/apimachinery from 0.19.4 to 0.20.0
2020-12-09 08:12:16 -05:00
a12323884f pkg/copy: introduce a Copier
Introduce a `Copier` object to separate the copy-rule enforcement from
copying.  That allows for a better error reporting of the REST API.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-12-09 14:05:17 +01:00
3aad9024b6 Merge pull request #8655 from vrothberg/fix-8605
auto updates: document systemd unit and timer
2020-12-09 07:43:31 -05:00
a59e2a1a11 Repeat system pruning until there is nothing removed
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 06:17:28 -05:00
37fbf28d74 Bump k8s.io/apimachinery from 0.19.4 to 0.20.0
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.19.4 to 0.20.0.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.19.4...v0.20.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 06:05:03 -05:00
0cb10eedb3 Bump github.com/opencontainers/selinux from 1.6.0 to 1.7.0
Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/opencontainers/selinux/releases)
- [Commits](https://github.com/opencontainers/selinux/compare/v1.6.0...v1.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 06:04:16 -05:00
c21bc8f034 auto updates: document systemd unit and timer
Fixes: #8605
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-12-09 12:03:42 +01:00
c2a5011c0d archive: move stat-header handling into copy package
Move handling the stat header into `pkg/copy`.  All copy-related should
ideally be located in this package to increase locality and reduce
scattering where possible.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-12-09 12:03:00 +01:00
bf5d184325 Fix spelling mistakes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 06:00:04 -05:00
8472efdbd1 pkg/copy: add parsing API
Add an API for parsing user input into a possibly specified container
and path.  This allows for sharing the parsing code between the local
and the remote client (and bindings) in the future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-12-09 11:24:32 +01:00
b13ae2b6dc make podman play use ENVs from image
fixes #8608.

Signed-off-by: Christopher J. Ruwe <cjr@cruwe.de>
2020-12-09 10:04:21 +01:00
dd295f297b Merge pull request #8652 from mheon/fix_8650
Correct port range logic for port generation
2020-12-08 19:05:25 -05:00