15354 Commits

Author SHA1 Message Date
a208bfaa52 Merge pull request #14421 from Luap99/stats
podman stats: work with network connect/disconnect
2022-06-02 04:26:04 -04:00
2958aee083 Merge pull request #14417 from Luap99/machine-ssh
podman machine ssh: set correct exit code
2022-06-02 04:24:01 -04:00
f27f9de5e6 Merge pull request #14448 from baude/issue14231
expose podman.sock in machine inspect
2022-06-02 04:20:06 -04:00
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
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
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
2c63b8a2fd Merge pull request #14439 from jakecorrenti/remove-hardcoded-imageStream-line
Removed `imageStream` hardcoded value
2022-06-01 15:00:57 -04:00
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
f5389dbb44 Merge pull request #14443 from Luap99/tail-logs-flake
fix "tail 800 lines: journald" flake
2022-06-01 12:20:17 -04:00
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
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
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
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
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
1933972909 Add ExecStop and dependencies to fix shutdown
Signed-off-by: Andrin Brunner <andrin@acloud.one>
2022-06-01 16:02:18 +02:00
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
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
398e7ceb86 Merge pull request #14433 from Luap99/restore-net
fix podman container restore without CreateNetNS
2022-05-31 14:46:30 -04:00
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
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
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
dc67e6a182 Merge pull request #14419 from Luap99/volume-import
podman volume export/import: give better error
2022-05-31 09:27:29 -04:00
ccc087a30e Merge pull request #14415 from nicrowe00/14133
no-new-privileges format
2022-05-31 05:07:28 -04:00
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
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
7e69e2b532 Podman no-new-privileges format
In docker, the format of no-new-privileges is
"no-new-privileges:true". However, for Podman
all that's required is "no-new-privileges", leading to issues
when attempting to use features desgined for docker in podman.
Adding support for the ":" format to be used along with the "="
format, depedning on which one is entered by the user.

fixes #14133
Signed-off-by: Niall Crowe <nicrowe@redhat.com>
2022-05-30 15:06:42 +01:00
0e58636c3a podman machine ssh: set correct exit code
Forward the ssh exit code to the podman caller. This is useful for
scripts. Use the same logic as podman unshare.

Fixes #14401

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-05-30 15:55:20 +02:00
a6f8cad545 fix bad import path for cmd/podman/utils
Libpod or packages under /pkg should never import from /cmd/...
This will quickly result in import cycles and weird code paths.
Also there is no reason to use this special code we can just use
syscall.SIGHUB as SIGNAL.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-05-30 15:29:08 +02:00
a550af260a Merge pull request #14383 from jwhonce/wip/info_todo
Add Authorization field to Plugins for Info
2022-05-27 10:55:35 -04:00
f48bf5808b Merge pull request #14393 from jwhonce/wip/archive_todo
Add API support for NoOverwriteDirNonDir
2022-05-27 10:43:36 -04:00
f23ae4d660 healthcheck: wait for systemd operations
Make sure to wait for the systemd operations to finish when
starting/stopping healtcheck timers and services.  Also make
sure to stop the timer before the service to avoid a race
with the timer.

[NO NEW TESTS NEEDED] since it is a non-functional change and existing
tests are expected to pass.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-05-27 13:10:35 +02:00
a72b2402c9 Merge pull request #14320 from flouthoc/build-honor-squash-and-layers
build: allow using `cache` explicitly with `--squash-all` using `--layers`
2022-05-27 06:37:19 -04:00
bdcf453118 Merge pull request #14387 from TomSweeneyRedHat/dev/tsweeney/quickdoc
[CI:DOCS] Quick typo for troubleshooting
2022-05-27 05:48:52 -04:00
8efdbf5c4c Add API support for NoOverwriteDirNonDir
Update method signatures and structs to pass option to buildah code

```release-note
NONE
```

[NO NEW TESTS NEEDED]

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-05-26 16:31:15 -07:00
e13c5f3a9e Refactor populating uptime
Refactor populating uptime field to use standard library parsing and
math for populating the hour, minute, seconds fields.

Note: the go-humanize package does not cover time.Duration just
time.time.

```release-note
NONE
```

[NO NEW TESTS NEEDED]

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-05-26 15:46:04 -07:00
3a32d60e5b [CI:DOCS] Quick typo for troubleshooting
After lgtming the latest from @flouthouc, I spotted one
more minor typo in the troubleshooting guide.  This corrects it.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2022-05-26 16:15:07 -04:00
1736f2fe60 Merge pull request #14382 from jwhonce/wip/init_todo
Remove TODO comment
2022-05-26 15:35:19 -04:00
e709cc88e7 Merge pull request #14377 from SoMuchForSubtlety/fix/pod-inspect-response
Fix swagger model of `InspectPodResponse`
2022-05-26 15:19:22 -04:00
ea1a8e2432 Move Attach under the OCI Runtime interface
With conmon-rs on the horizon, we need to disentangle Libpod from
legacy Conmon to the greatest extent possible. There are
definitely opportunities for codesharing between the two, but we
have to assume the implementations will be largely disjoint given
the different architectures.

Fortunately, most of the work has already been done in the past.
The conmon-managed OCI runtime mostly sits behind an interface,
with a few exceptions - the most notable of those being attach.
This PR thus moves Attach behind the interface, to ensure that we
can have attach implementations that don't use our existing unix
socket streaming if necessary.

Still to-do is conmon cleanup. There's a lot of code that removes
Conmon-specific files, or kills the Conmon PID, and all of it
will need to be refactored behind the interface.

[NO NEW TESTS NEEDED] Just moving some things around.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-05-26 14:57:08 -04:00
49ef9eb52a Merge pull request #14374 from umohnani8/todo-3
Combine the CheckAllLatest CID and PodID functions
2022-05-26 14:27:24 -04:00
fb163976f4 Support setting image_volume_mode in containers.conf
Fixes: https://github.com/containers/podman/issues/14230

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-05-26 14:16:26 -04:00
d730f2b254 Add Authorixation field to Plugins for Info
The Authorization field lists the plugins for granting access to the
Docker daemon. This field will always be nil for Podman as there is no
daemon. The field is included for compatibility.

```release-note
NONE
```

[NO NEW TESTS NEEDED]

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-05-26 11:15:48 -07:00
5f097c371f Merge pull request #14355 from flouthoc/server-client-compat-for-bug-fix
[CI:Docs]: note regarding version compatablity between server and client for bug fixes.
2022-05-26 14:15:22 -04:00
2ce31caa1c Merge pull request #14381 from cevich/fix_cirrus_todo
[CI:DOCS] Cirrus: Fix several TODOs
2022-05-26 14:13:20 -04:00
bf403c8d3f Merge pull request #14373 from umohnani8/todo-2
Fix TODO in pod/ps.go and parse/net.go
2022-05-26 13:59:09 -04:00
ab0728421b docs: note regarding version compatablity between server and client for bug fixes
Add a small note to troubleshooting docs regaring version parity between
podman-client and podman-server when looking for bug fixes.

[NO TESTS NEEDED]
[NO NEW TESTS NEEDED]

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

Signed-off-by: Aditya R <arajan@redhat.com>
2022-05-26 23:24:18 +05:30
87ad460603 Remove TODO comment
Allowing custom flags to provider has the potential to break all the
hand-crafted commands currently in use. This could become a support
nightmare.

```release-note
NONE
```

[NO NEW TESTS NEEDED]

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2022-05-26 10:26:38 -07:00
66a56ce05a vendor: bump buildah to v1.26.1-0.20220524184833-5500333c2e06
Bump buildah to v1.26.1-0.20220524184833-5500333c2e06

Signed-off-by: Aditya R <arajan@redhat.com>
2022-05-26 21:01:31 +05:30
6124b51993 build: allow using cache explicitly with --squash-all using --layers
Buildah already supports using `--layers` with `--squash` after https://github.com/containers/buildah/pull/3674
if user wants to do so hence podman must honor similar configuration
in `--squash-all` behaviour if user wants to using cache.

PS: We cannot alter behaviour of `podman build --squash` for
docker-compat reasons hence this feature can be easily supported by
`--squash-all`.

Closes: https://github.com/containers/buildah/issues/4011

Signed-off-by: Aditya R <arajan@redhat.com>
2022-05-26 21:01:18 +05:30
8c1128db4b Cirrus: Fix several TODOs
Most were simply deleted, the main one addressed is in the
"pre-testing" `ext_svc_check.sh` script.  It will now verify
accessibility of several key test images we maintain in `quay.io`.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-05-26 11:23:53 -04:00