14577 Commits

Author SHA1 Message Date
f0c6114a39 Merge pull request #13380 from jwhonce/wip/docker-py
Refactor docker-py compatibility tests
2022-03-01 15:20:38 -05:00
22f331e540 Revert "use GetRuntimeDir() from c/common"
This reverts commit fc5cf812c81a10f8a021aae11df5f12ab2a6f6f6.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-03-01 13:23:43 -06:00
572e6464f6 Use storage that better supports rootless overlayfs
overlayfs -- the kernel's version, not fuse-overlayfs -- recently learned
(as of linux 5.16.0, I believe) how to support rootless users. Previously,
rootless users had to use these storage.conf(5) settings:

* storage.driver=vfs          (aka STORAGE_DRIVER=vfs), or
* storage.driver=overlay      (aka STORAGE_DRIVER=overlay),
  storage.options.overlay.mount_program=/usr/bin/fuse-overlayfs
                              (aka STORAGE_OPTS=/usr/bin/fuse-overlayfs)

Now that a third backend is available, setting only:

* storage.driver=overlay      (aka STORAGE_DRIVER=overlay)

https://github.com/containers/podman/issues/13123 reported EXDEV errors
during the normal operation of their container. Tracing it out, the
problem turned out to be that their container was being mounted without
'userxattr'; I don't fully understand why, but mount(8) mentions this is
needed for rootless users:

> userxattr
>
>   Use the "user.overlay." xattr namespace instead of "trusted.overlay.".
>   This is useful for unprivileged mounting of overlayfs.

https://github.com/containers/storage/pull/1156 found and fixed the issue
in podman, and this just pulls in that via

    go get github.com/containers/storage@ebc90ab
    go mod vendor
    make vendor

Closes https://github.com/containers/podman/issues/13123

Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
2022-03-01 12:09:42 -05:00
7729afe979 Refactor docker-py compatibility tests
* Add which python client is being used to run tests, see "python
  client" below.
* Remove redundate code from test classes
* Update/Add comments to modules and classes

======================================================= test session starts ========================================================
platform linux -- Python 3.10.0, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
python client -- DockerClient
rootdir: /home/jhonce/Projects/go/src/github.com/containers/podman
plugins: requests-mock-1.8.0
collected 33 items

test/python/docker/compat/test_containers.py ...s..............  [ 54%]
test/python/docker/compat/test_images.py ............  [ 90%]
test/python/docker/compat/test_system.py ...  [100%]

Note: Follow-up PRs will verify the test results and expand the tests.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-03-01 09:06:52 -07:00
675d775eb5 Add --context-dir option to podman play kube
This option was requested so that users could specify alternate
locations to find context directories for each image build. It
requites the --build option to be set.

Partion Fix: https://github.com/containers/podman/issues/12485

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-03-01 08:47:09 -05:00
8bdda91ab7 Merge pull request #13362 from keonchennl/pod-logs-add-flag
Add the names flag for pod logs
2022-03-01 08:43:50 -05:00
87d22e1014 Merge pull request #13318 from rhatdan/volume
Add podman volume mount support
2022-03-01 03:53:21 -05:00
86a057e6be Merge pull request #13374 from cevich/fix_dupe_docker_testing
Clarify v2 API testing for podman vs docker clients
2022-02-28 18:43:18 -05:00
4c529529bd Merge pull request #13372 from ashley-cui/binarypath
Allow setting binarypath from Makefile
2022-02-28 18:41:28 -05:00
40c6192e9e Add the names flag for pod logs
Fixes containers#13261

Signed-off-by: Xueyuan Chen <X.Chen-47@student.tudelft.nl>
2022-03-01 00:18:39 +01:00
2e14c72707 Allow setting binarypath from Makefile
Packagers for other distributions and package managers may put their helper binaries in other location prefixes.
Add HELPER_BINARIES_DIR to the makefile so packagers can set the prefix when building Podman.
HELPER_BINARIES_DIR will be set at link-time.

Example usage: make podman-remote HELPER_BINARIES_DIR=/my/location/prefix

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-02-28 16:24:15 -05:00
569319d397 Vendor in containers/common@main
Signed-off-by: Ashley Cui <acui@redhat.com>
2022-02-28 16:23:26 -05:00
3dc1b8e83f Add podman volume mount support
Fixes: https://github.com/containers/podman/issues/12768

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-02-28 14:26:22 -05:00
dbf34bfe70 Clarify v2 API testing for podman vs docker clients
Fixes: #13273

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-02-28 13:15:07 -05:00
c39dffe83d Merge pull request #13353 from lsm5/copr-packaging-macro
copr packaging: use generic macros for tmpfiles and modules load dirs
2022-02-26 11:29:25 -05:00
988190db58 copr packaging: use generic macros for tmpfiles and modules load dirs
[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-02-25 13:56:19 -05:00
2225c65f74 Merge pull request #13343 from afbjorklund/dpkg-package
Show version of the deb package in info output
2022-02-25 08:53:01 -05:00
6f71fa6d9d Show version of the deb package in info output
Previously just showing name of the package, followed by
the path repeated again (already stated on the line above)

[NO NEW TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2022-02-24 20:24:31 +01:00
2cb011ef2b Merge pull request #13336 from containers/dependabot/go_modules/github.com/containernetworking/plugins-1.1.0
Bump github.com/containernetworking/plugins from 1.0.1 to 1.1.0
2022-02-24 12:18:41 -05:00
874bde2050 Merge pull request #13325 from xordspar0/configmap-error-msg
Improve the error message for usused configMaps
2022-02-24 12:16:40 -05:00
a7fc8a1460 Improve the error message for usused configMaps
If you run `podman play kube` on a yaml file that only contains
configMaps, podman will fail with the error:

	Error: YAML document does not contain any supported kube kind

This is not strictly true; configMaps are a supported kube kind. The
problem is that configMaps aren't a standalone entity. They have to be
used in a container somewhere, otherwise they don't do anything.

This change adds a new message in the case when there only configMaps
resources. It would be helpful if podman reported which configMaps are
unused on every invocation of kube play. However, even if that feedback
were added, this new error messages still helpfully explains the reason
that podman is not creating any resources.

[NO NEW TESTS NEEDED]

Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2022-02-24 08:59:11 -06:00
f3e883fb4c Bump github.com/containernetworking/plugins from 1.0.1 to 1.1.0
Bumps [github.com/containernetworking/plugins](https://github.com/containernetworking/plugins) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/containernetworking/plugins/releases)
- [Commits](https://github.com/containernetworking/plugins/compare/v1.0.1...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/containernetworking/plugins
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-24 12:13:02 +00:00
283fd60e9d Merge pull request #13333 from vrothberg/systemd-docs-infra-container
[CI:DOCS] generate-systemd: pod requires an infra container
2022-02-24 05:51:40 -05:00
e1b2981665 docs: generate-systemd: pod requires an infra container
Generating unit files for a pod requires the pod to be created with an
infra container (see `--infra=true`).  An infra container runs across
the entire lifespan of a pod and is hence required for systemd to manage
the life cycle of the pod's main unit.

This issue came up on the mailing list.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-02-24 10:58:18 +01:00
0d2bd53f37 Merge pull request #13157 from ydayagi/main
play kube: set defaults to container resources
2022-02-23 13:34:59 -05:00
991c90de1f Merge pull request #13314 from flouthoc/container-commit-squash
container-commit: support `--squash` to squash layers into one if users want.
2022-02-23 13:07:00 -05:00
113f855802 Merge pull request #13323 from Luap99/iptables-module
Load ip_tables modules at boot
2022-02-23 11:58:58 -05:00
d3699bbce6 Merge pull request #13231 from eriksjolund/troubleshooting_mention_systemd-run_and_machinectl
[CI:DOCS] troubleshooting: mention machinectl and systemd-run
2022-02-23 10:29:12 -05:00
eab5a4cfb7 Load ip_tables modules at boot
Rootless users cannot load the ip_tables module, in fedora 36 this
module is no longer loaded by default so we have to add it manually.
This is needed because rootless network setup tries to use iptables
and if iptables-legacy is used instead of iptables-nft it will fail.

To provide a better user experience we will load the module at boot.

Note that this is not needed for RHEL because iptables-legacy is not
supported on RHEL 8 and newer.

[NO NEW TESTS NEEDED]

Fixes #12661

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-02-23 16:11:19 +01:00
a234e4e196 Merge pull request #13317 from elezar/update-cdi-module
Update CDI go dependency to v0.3.0
2022-02-23 10:01:04 -05:00
cbca58e8d7 Merge pull request #13320 from giuseppe/play-kube-honor-propagation-mode
kube: honor mount propagation mode
2022-02-23 09:25:07 -05:00
fbbcb957c7 container-commit: support --squash to squash layers into one
Allow users to commit containers into a single layer.

Usage
```bash
podman container commit --squash <name>
```

Signed-off-by: Aditya R <arajan@redhat.com>
2022-02-23 17:38:28 +05:30
ed73040b35 kube: honor mount propagation mode
convert the propagation mode specified for the mount to the expected
Linux mount option.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-02-23 13:01:40 +01:00
5cba5cbfdb play kube: set defaults to container resources
this fixes https://github.com/containers/podman/issues/13115

the change tries to immitate k8s behavior.
when limits are not set the container's limits are all CPU and all RAM
when requests are missing then they are equal to limits

Signed-off-by: Yaron Dayagi <ydayagi@redhat.com>
2022-02-23 11:00:09 +02:00
8b2432422f Merge pull request #13232 from rhatdan/volumes
Don't log errors on removing volumes inuse, if container --volumes-from
2022-02-23 03:26:59 -05:00
46b7c5bc63 Bump CDI go dependency to v0.3.0
This updates the CDI dependency to the v0.3.0 tagged version instead of
relying on a pseudo version. This also addresses the fact that cgroups
are not set correctly for devices using the previous dependency.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2022-02-23 08:02:47 +02:00
ccb96a2791 Merge pull request #13247 from rhatdan/trust
Cleanup display of trust with transports
2022-02-23 00:46:51 -05:00
bc0e084f2d Merge pull request #13276 from rhatdan/containers-common
Add containers-common spec and command to podman
2022-02-22 16:30:52 -05:00
6f7a803d06 Cleanup display of trust with transports
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-02-22 15:08:58 -05:00
80c5962dba Add containers-common spec and command to podman
Since containers-common package is tied to specific versions
of Podman, add tools to build the package into the contrib directory
This should help other distributions to figure out which commont
package to ship.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-02-22 14:38:57 -05:00
d3903a8591 Merge pull request #13311 from mheon/remove_runtime_lock
Remove the runtime lock
2022-02-22 13:46:52 -05:00
4a60319ecb Remove the runtime lock
This primarily served to protect us against shutting down the
Libpod runtime while operations (like creating a container) were
happening. However, it was very inconsistently implemented (a lot
of our longer-lived functions, like pulling images, just didn't
implement it at all...) and I'm not sure how much we really care
about this very-specific error case?

Removing it also removes a lot of potential deadlocks, which is
nice.

[NO NEW TESTS NEEDED]

Signed-off-by: Matthew Heon <mheon@redhat.com>
2022-02-22 11:05:26 -05:00
fab82a7c9c Merge pull request #13059 from cdoern/clone
Implement Podman Container Clone
2022-02-22 10:10:49 -05:00
948dfc6f02 Merge pull request #13280 from baude/updatetutorials
[CI:DOCS]Update networking tutorial for netavark
2022-02-22 09:44:54 -05:00
0cfb5d7e75 Merge pull request #13308 from Luap99/remove-nets
system tests: cleanup networks on teardown
2022-02-21 17:55:37 -05:00
c4dfbd58f5 Don't log errors on removing volumes inuse, if container --volumes-from
When removing a container created with a --volumes-from a container
created with a built in volume, we complain if the original container
still exists.  Since this is an expected state, we should not complain
about it.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-02-21 16:47:12 -05:00
b19251242e system tests: cleanup networks on teardown
When a test which creates a network fail it will not remove the network.
The teardown logic should remove the networks. Since there is no --all
option for network rm we use network prune --force.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-02-21 21:57:08 +01:00
a746a61a17 Merge pull request #13286 from flouthoc/kube-build-false-default
kube: honor `--build=false` if specified.
2022-02-21 15:33:39 -05:00
c3a9505232 Merge pull request #13304 from Luap99/runtimedir
use GetRuntimeDir() from c/common
2022-02-21 15:23:38 -05:00
b3963e7081 Merge pull request #13296 from Romain-Geissler-1A/url-and-connection-implies-remote
Option --url and --connection should imply --remote.
2022-02-21 15:21:37 -05:00