Commit graph

15329 commits

Author SHA1 Message Date
cdoern b13fc1bf98 patch for pod host networking & other host namespace handling
this patch included additonal host namespace checks when creating a ctr as well
as fixing of the tests to check /proc/self/ns/net

see #14461

Signed-off-by: cdoern <cdoern@redhat.com>
2022-06-09 10:30:48 -04:00
OpenShift Merge Robot 0dda468192
Merge pull request #14437 from cevich/fix_podmanimage
[CI:BUILD] Podman image: Mass cleanup + fix missing storage.conf
2022-06-03 13:17:14 -04:00
OpenShift Merge Robot 8f79604864
Merge pull request #14475 from vrothberg/fix-14468
test/e2e/save_test.go: fix flake
2022-06-03 10:04:47 -04:00
Valentin Rothberg 2b0cb30026 test/e2e/save_test.go: fix flake
Save at most three images and sort them by size.  The test started to
flake as _all_ local images were saved which is not neccessary.

Fixes: #14468
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-06-03 14:22:25 +02:00
OpenShift Merge Robot f7a54088c3
Merge pull request #14470 from shanesmith/machine-force-remove-doesnt-stop
Stop machine before force removing files
2022-06-03 04:29:02 -04:00
OpenShift Merge Robot 6edbf3baaa
Merge pull request #14461 from cdoern/infra
fix pod network handling with a host network
2022-06-02 21:28:26 -04:00
OpenShift Merge Robot 232f2c9eb8
Merge pull request #14455 from containers/dependabot/go_modules/github.com/containernetworking/cni-1.1.1
Bump github.com/containernetworking/cni from 1.1.0 to 1.1.1
2022-06-02 21:26:23 -04:00
OpenShift Merge Robot 5e15a26e0e
Merge pull request #14460 from cipherboy/align-docker-podman-load-output
Align docker load and podman load output
2022-06-02 21:24:26 -04:00
OpenShift Merge Robot 38720d91af
Merge pull request #14467 from karthikelango137/bytes
[CI:DOCS] changed megabyte to mebibyte
2022-06-02 19:59:25 -04:00
Shane Smith b8de285a42
Stop machine before force removing files
In #13466 the ability to force remove a machine while it's running was
added but it did not first stop the machine, all files get deleted but
the qemu VM would essentially be orphaned.

[NO NEW TESTS NEEDED]

Signed-off-by: Shane Smith <shane.smith@shopify.com>
2022-06-02 16:58:43 -04:00
Alexander Scheel 1b6505d74b Update test output expectation
Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2022-06-02 16:05:05 -04:00
Karthik Elango 9a34b88c9a changed megabyte to mebibyte
In podman run --help, the message said megabyte, gigabyte, etc. In reality podman takes mebibytes, gibibytes, etc.

[CI:DOCS]

Signed-off-by: Karthik Elango <kelango@redhat.com>
2022-06-02 14:58:39 -04:00
OpenShift Merge Robot 2777ecd53e
Merge pull request #14435 from cevich/makefile_empty
Makefile: Handle unexpected empty var. values
2022-06-02 14:40:22 -04:00
OpenShift Merge Robot 95888735e3
Merge pull request #14384 from mheon/move_attach
Move Attach under the OCI Runtime interface
2022-06-02 14:20:25 -04:00
cdoern 831d6534fb fix pod network handling with a host network
the function `GetDefaultNamespaceMode` for pods checks if we are sharing each namespace
and if not, returns the default which in the case of a network is slirp.

add a switch case for explicitly checking if the pod's network mode is host
and if so, return specgen.Host for the container

resolves #13763

Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
Signed-off-by: cdoern <cdoern@redhat.com>
2022-06-02 14:16:28 -04:00
OpenShift Merge Robot be527a358a
Merge pull request #14457 from Luap99/completion4
shell completion for paths inside the image/container
2022-06-02 14:02:11 -04:00
Alexander Scheel 5023ce585c Align docker load and podman load output
The comma-separated podman load output isn't conducive for using the
subsequent images. For tarballs with multiple images, the comma
separator must be manually identified and a suitable range identified.

Docker CLI on the other hand, has one image identifier per line:

Loaded image: repo1/name1:latest
Loaded image: repo1/name1:tag1
Loaded image: repo2/name2:tag1

(as of Docker version 20.10.16, build aa7e414).

Switch `podman load` to this format for consistency and usability.

[NO NEW TESTS NEEDED]

Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
2022-06-02 13:54:04 -04:00
Paul Holzinger f2bbbd20da
shell completion for paths inside the image/container
Add shell completion for paths inside the container or image. Currently
podman run IMAGE [TAB] only uses the default shell completion which
suggests paths on the host. This is fine for some cases but often the
user wants a path which only exists in the image/container.

This commits adds support for that. Both podman create/run can now
complete the paths from the image, podman cp ctr:... now completes paths
from the actual container.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-02 17:23:22 +02:00
OpenShift Merge Robot 570c2492a3
Merge pull request #14451 from PhrozenByte/bugfix/docs-publish
[CI:DOCS] Document protocol usage for --publish
2022-06-02 10:48:18 -04:00
OpenShift Merge Robot 13cdf862e6
Merge pull request #14301 from rhatdan/volume
Support setting image_volume_mode in containers.conf
2022-06-02 10:16:28 -04:00
OpenShift Merge Robot 8b972ff8ca
Merge pull request #14436 from Luap99/net-remote-default
pkg/specgen: parse default network mode on server
2022-06-02 08:48:07 -04:00
Daniel Rudolf 5b9729c479
Document protocol usage for --publish
This also unifies the documentation of `--publish` for `podman create`, `podman run`, and `podman pod create`.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2022-06-02 14:26:51 +02:00
dependabot[bot] 6dffa453a4
Bump github.com/containernetworking/cni from 1.1.0 to 1.1.1
Bumps [github.com/containernetworking/cni](https://github.com/containernetworking/cni) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/containernetworking/cni/releases)
- [Commits](https://github.com/containernetworking/cni/compare/v1.1.0...v1.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-02 12:09:57 +00:00
OpenShift Merge Robot e60c41657b
Merge pull request #14395 from vrothberg/healthcheck-fix
healthcheck: wait for systemd operations
2022-06-02 05:26:07 -04:00
OpenShift Merge Robot e4e100638d
Merge pull request #14344 from cdoern/podCreate
podman pod create --uidmap patch
2022-06-02 04:33:03 -04:00
OpenShift Merge Robot a208bfaa52
Merge pull request #14421 from Luap99/stats
podman stats: work with network connect/disconnect
2022-06-02 04:26:04 -04:00
OpenShift Merge Robot 2958aee083
Merge pull request #14417 from Luap99/machine-ssh
podman machine ssh: set correct exit code
2022-06-02 04:24:01 -04:00
OpenShift Merge Robot f27f9de5e6
Merge pull request #14448 from baude/issue14231
expose podman.sock in machine inspect
2022-06-02 04:20:06 -04:00
OpenShift Merge Robot 516c95526a
Merge pull request #14446 from andrin55/podman-restart-service-shutdown-fix
podman-restart.service: Add ExecStop and dependencies to fix shutdown
2022-06-02 03:01:49 -04:00
Chris Evich 3fa09e9dba
Makefile: Handle unexpected empty var. values
Fixes #14021

Substitution values built from `$(shell ...)` output can easily be empty
due to the shell's default `pipefail` behavior.  This can also hide
non-zero exit codes, similarly resulting in empty values being set.
While not a perfect fix, the situation is improved by using the
`err_if_empty` function in all cases where empty values would be
unexpected.  Remove the definitions for `GIT_BRANCH` and
`GIT_BRANCH_CLEAN` which don't seem to actually be used anywhere
(including in code).

Add a simple release-test to verify `podman info` outputs a non-empty
value for "GitCommit".

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-06-01 17:42:11 -04:00
Chris Evich fc95f832a5
Podman image: Mass cleanup + fix missing storage.conf
As of Fedora 36, `/etc/containers/storage.conf` with defaults is
installed under `/usr/share/containers/`.  This was causing builds
to fail in the necessary `sed` command that enables fuse-overlayfs.
Fix this by using sed on the new location with an output redirect
into the `etc` location.

Also, perform a mass-cleanup of the three files to make them easier
to read/maintain.  Including renaming them to `Containerfile`,
since all native build tooling is now used to produce them.

Lastly, take advantage of the `podman-next` copr repository to install
the latest/greatest podman from `main`, rather than building it from
scratch.  This will greatly speed up the image build speed.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-06-01 17:25:38 -04:00
OpenShift Merge Robot 2c63b8a2fd
Merge pull request #14439 from jakecorrenti/remove-hardcoded-imageStream-line
Removed `imageStream` hardcoded value
2022-06-01 15:00:57 -04:00
cdoern f728b7b5a7 podman pod create --uidmap patch
podmans remote API does not marshal infra's spec due to
the fact that if it did, all of those options would be available to
the users on the command line. This means we need to manually map "backwards"
some container spec items -> pod spec items before calling PodCreate, this was
one of them that was forgotten

resolves #14233

Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
Signed-off-by: cdoern <cdoern@redhat.com>
2022-06-01 12:45:00 -04:00
OpenShift Merge Robot f5389dbb44
Merge pull request #14443 from Luap99/tail-logs-flake
fix "tail 800 lines: journald" flake
2022-06-01 12:20:17 -04:00
Brent Baude 8291b51ceb expose podman.sock in machine inspect
For consumers of the podman.sock who want a predictable way to find the
podman sock, we now include it under 'ConnectionConfig' in podman
machine inspect.

Fixes: #14231

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-06-01 10:48:17 -05:00
Jake Correnti dbdc26a4cf Removed imageStream hardcoded value
[NO NEW TESTS NEEDED] Removed `imageStream` hardcoded value  that was set to
testing. Since podman4 is in the fcos trees, it should be removed. The
respective comments have also been removed.

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-06-01 11:44:35 -04:00
Daniel J Walsh 2039445763
Merge pull request #14444 from Luap99/remote-static-linux
Makefile: force podman-remote-static to linux
2022-06-01 11:35:46 -04:00
Paul Holzinger 2805c7353b
pkg/specgen: parse default network mode on server
When podman-remote is used we should not resolve the default network
mode on the client. Defaults should be set on the server. In this case
this is important because we have different defaults for root/rootless.
So when the client is rootless and the server is root we must pick the
root default.

Note that this already worked when --network was set since we did not
parsed the flag in this case. To reproduce you need --network=default.

Also removed a unused function.

[NO NEW TESTS NEEDED] I tested it manually but I am not sure how I can
hook a test like this up in CI. The client would need to run as rootless
and the server as root or the other way around.

Fixes #14368

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-01 17:13:30 +02:00
Paul Holzinger 78d1f5d7d6
fix "tail 800 lines: journald" flake
The test calls podman run -d followed by podman logs. There is no
guarantee the the container or conmon has written all its output.
Adding an extra podman wait should fix this.

Do not remove the -d to not print 1000 unnecessary lines in the logs.

Fixes #14362

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-01 16:49:10 +02:00
Andrin Brunner 1933972909
Add ExecStop and dependencies to fix shutdown
Signed-off-by: Andrin Brunner <andrin@acloud.one>
2022-06-01 16:02:18 +02:00
Paul Holzinger f91c852fa6
Makefile: force podman-remote-static to linux
Some of the targets overwrite $GOOS. Since podman-remote-static should
always build for linux we can force linux GOOS here.

Fixes #14201

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-01 15:38:01 +02:00
OpenShift Merge Robot 70ce77e8d0
Merge pull request #14424 from lsm5/gopkg-in-yaml-bump
Bump gopkg.in/yaml.v3 to v3.0.1
2022-06-01 09:09:20 -04:00
OpenShift Merge Robot 398e7ceb86
Merge pull request #14433 from Luap99/restore-net
fix podman container restore without CreateNetNS
2022-05-31 14:46:30 -04:00
Lokesh Mandvekar cef044d859
Bump gopkg.in/yaml.v3 to v3.0.1
v3.0.1 resolves GHSA-hp87-p4gw-j4gq -  CVE-2022-28948.

While podman doesn't appear to be vulnerable to the CVE as the concerned
code isn't being called, this update should silence a dependabot alert.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-05-31 13:01:50 -04:00
Paul Holzinger 205c8c071e
fix podman container restore without CreateNetNS
When a container does not use the default podman netns, for example
--network none or --network ns:/path a restore would fail because the
specgen check validates that c.config.StaticMAC is nil but the
unmarshaller sets it to an empty slice.

While we could make the check use len() > 0 I feel like it is more
common to check with != nil for ip and mac addresses.
Adding omitempty tag makes the json marshal/unmarshal work correctly.
This should not cause any issues.

Fixes #14389

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-05-31 16:49:40 +02:00
Paul Holzinger 16e8b2f32e
podman stats: work with network connect/disconnect
Hardcoding the interface name is a bad idea. We have no control over the
actual interface name since the user can change it.

The correct thing is to read them from the network status. Since the
contianer can have more than one interface we have to add the RX/TX
values. The other values are currently not used.

For podman 5.0 we should change it so that the API can return the
statistics per interface and the client should sum the TX/RX for the
command output. This is what docker is doing.

Fixes #13824

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-05-31 15:31:07 +02:00
OpenShift Merge Robot dc67e6a182
Merge pull request #14419 from Luap99/volume-import
podman volume export/import: give better error
2022-05-31 09:27:29 -04:00
OpenShift Merge Robot ccc087a30e
Merge pull request #14415 from nicrowe00/14133
no-new-privileges format
2022-05-31 05:07:28 -04:00
Paul Holzinger ec576a5491
podman volume export/import: give better error
When the volume does not exist we should output an error stating so and
not some generic one.

Fixes #14411

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-05-30 18:10:28 +02:00
Paul Holzinger 4a83465511
podman machine ssh: do not print warning everytime
Currenlty this ssh warning is printed everytime:
`Warning: Permanently added '[localhost]:33915' (ED25519) to the list of known hosts.`

Since this is very anoying and makes it harder to capture the actual
command output we should silence this. With log level error we will only
see the important messages from ssh.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-05-30 16:21:11 +02:00