11893 Commits

Author SHA1 Message Date
ab4d0cf908 Merge pull request #10658 from mheon/bump_321
Bump to v3.2.1
2021-06-14 13:13:02 -04:00
60752b3206 Bump to v3.2.2-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-14 10:35:09 -04:00
152952fe6b Bump to v3.2.1
Also, revert minimum API version for the Libpod remote API to
v3.1.0.

Signed-off-by: Matthew Heon <mheon@redhat.com>
v3.2.1
2021-06-14 10:35:09 -04:00
c5d9c0a6fa Updated release notes for v3.2.1
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-14 10:35:09 -04:00
4f56f7f133 Fix network connect race with docker-compose
Network connect/disconnect has to call the cni plugins when the network
namespace is already configured. This is the case for `ContainerStateRunning`
and `ContainerStateCreated`. This is important otherwise the network is
not attached to this network namespace and libpod will throw errors like
`network inspection mismatch...` This problem happened when using
`docker-compose up` in attached mode.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-14 10:35:09 -04:00
e42d727a97 Revert "Ensure minimum API version is set correctly in tests"
This reverts commit 9647d88449f44028c9b870af74e5e44cb819ff9d. We
reverted the API bump (was a mistake, should have been left at
3.1.0) and now we need to revert the test changes.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-14 10:35:09 -04:00
f69789155a Fall back to string for dockerfile parameter
a9cb824981db3fee6b8445b29e513c89e9b9b00b changed the expectations of the
dockerfile parameter to be json data however it's a string. In order to
support both, let's attempt json and fall back to a string if the json
parsing fails.

Closes #10660

Signed-off-by: Alex Schultz <aschultz@redhat.com>
2021-06-14 10:34:35 -04:00
5a158563c0 remote events: fix --stream=false
Fix a bug in remote events where only one event would be sent if when
streaming is turned off.  The source of the bug was that the handler
attempted to implement the streaming logic and did it wrong.  The fix is
rather simple by removing this logic from the handler and let the events
backend handle streaming.

Fixes: #10529
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-11 13:06:07 -04:00
38fbd2cb9e [CI:DOCS] fix incorrect network remove api doc
The endpoint returns an array and not a single entry.

Fixes #10494

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-11 13:06:07 -04:00
26eae3bf89 remote: always send resize before the container starts
There is race condition in the remote client attach logic. Because the
resize api call was handled in an extra goroutine the container was
started before the resize call happend. To fix this we have to call
resize in the same goroutine as attach. When the first resize is done
start a goroutine to listen on SIGWINCH in the background and resize
again if the signal is received.

Fixes #9859

Signed-off-by: Paul Holzinger <pholzing@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-11 13:06:07 -04:00
c751544fac remote events: support labels
Certain event meta data was lost when converting the remote events to
libpod events and vice versa.  Enable the skipped system tests for
remote.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-11 13:06:07 -04:00
c28f442b28 remote pull: cancel pull when connection is closed
If a client closes the http connection during image pull, the
service should cancel the pull operation.

[NO TESTS NEEDED] I have no idea how we could test this reliable.

Fixes: #7558

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-11 13:06:07 -04:00
2993bdf1ef Fix network prune api docs
The api doc used wrong response examples for both the compat and libpod
network prune endpoints. Change the doc so that it matches the actual
return values. Also fix the endpoints to return an empty array instead
of null when no networks are removed.

[NO TESTS NEEDED]

Fixes: #10564

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-11 13:06:06 -04:00
8ba0c92e6a Improve systemd-resolved detection
When 127.0.0.53 is the only nameserver in /etc/resolv.conf assume
systemd-resolved is used. This is better because /etc/resolv.conf does
not have to be symlinked to /run/systemd/resolve/stub-resolv.conf in
order to use systemd-resolved.

[NO TESTS NEEDED]

Fixes: #10570

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-11 13:06:06 -04:00
c3f6ef63a2 logs: k8s-file: fix race
Fix a race in the k8s-file logs driver.  When "following" the logs,
Podman will print the container's logs until the end.  Previously,
Podman logged until the state transitioned into something non-running
which opened up a race with the container still running, possibly in
the "stopping" state.

To fix the race, log until we've seen the wait event for the specific
container.  In that case, conmon will have finished writing all logs to
the file, and Podman will read it until EOF.

Further tweak the integration tests for testing `logs -f` on a  running
container.  Previously, the test only checked for one of two lines
stating that there was a race.  Indeed the race was in using `run --rm`
where a log file may be removed before we could fully read it.

Fixes: #10596
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-11 13:06:06 -04:00
f1e7a07473 Fix image prune --filter cmd behavior
Image prune --filter is fully implemented in the api, http api
yet not connected with the cli execution. User trying to use
filters does not see the effect. This commit adds glue code to enable
possiblity of using --filter in prune in the cli execution.

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-06-11 13:06:06 -04:00
5ddd76edd0 Several shell completion fixes
- fix network filters
- add prune filters
- pod create --share support comma separated namespaces

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-06-11 13:06:06 -04:00
2afb5eeab6 podman-remote build should handle -f option properly
podman-remote build has to handle multiple different locations
for the Containerfile.  Currently this works in local mode but not
when using podman-remote.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-06-11 11:14:04 -04:00
6beae86f01 System tests: deal with crun 0.20.1
crun 0.20.1 changed an error message that we relied on. Deal
with it by accepting the old and new message.

Also (unrelated): sneak in some doc fixes to get rid of
nasty go-md2man warnings that have crept into man pages.

Signed-off-by: Ed Santiago <santiago@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-11 11:09:42 -04:00
80362b34c4 Fix build tags for pkg/machine...
Podman machine is only intended for amd64 and arm64 architectures, set
the correct buildtags so that the `pkg/machine`, `pkg/machine/qemu` and
`pkg/machine/libvirt` packages compile correctly.

[NO TESTS NEEDED]

Fixes #10625

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-11 11:08:18 -04:00
c85b6b3fe1 Fix pre-checkpointing
Unfortunately --pre-checkpointing never worked as intended and recent
changes to runc have shown that it is broken.

To create a pre-checkpoint CRIU expects the paths between the
pre-checkpoints to be a relative path. If having a previous checkpoint
it needs the be referenced like this: --prev-images-dir ../parent

Unfortunately Podman was giving runc (and CRIU) an absolute path.

Unfortunately, again, until March 2021 CRIU silently ignored if
the path was not relative and switch back to normal checkpointing.

This has been now fixed in CRIU and runc and running pre-checkpoint
with the latest runc fails, because runc already sees that the path is
absolute and returns an error.

This commit fixes this by giving runc a relative path.

This commit also fixes a second pre-checkpointing error which was just
recently introduced.

So summarizing: pre-checkpointing never worked correctly because CRIU
ignored wrong parameters and recent changes broke it even more.

Now both errors should be fixed.

[NO TESTS NEEDED]

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Adrian Reber <adrian@lisas.de>
2021-06-11 11:06:56 -04:00
b61701acb3 container: ignore named hierarchies
when looking up the container cgroup, ignore named hierarchies since
containers running systemd as payload will create a sub-cgroup and
move themselves there.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-06-11 11:05:09 -04:00
41fcd4d8ed Merge pull request #10636 from vrothberg/v3.2-vendor-common
[v3.2] vendor containers/common@v0.38.9
2021-06-10 16:10:18 -04:00
e0dcffa8d1 [v3.2] vendor containers/common@v0.38.9
The fixes will allow for creating containers with a corrupted image in
which case the image will be repulled.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1966872
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-10 18:31:17 +02:00
3d21dfe484 Merge pull request #10631 from giuseppe/v32-fix-rootless-join
[v3.2] rootless: fix fast join userns path
2021-06-10 09:40:17 -04:00
d46deca8c8 rootless: fix fast join userns path
commit ab886328357184cd0a8375a5dedf816ba91789f9 changed the path for
the pause.pid file but didn't update the same path in the C code.
This prevented Podman to take the fast path when the userns is already
created and to join it without re-execing itself.

Fix the path in the C code as well so we can join the rootless
user+mount namespace without having to re-exec Podman.

[NO TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit 11badab046d32c0dce40b28707ee3bb72678e36e)
2021-06-10 09:26:06 +02:00
a894a36962 Merge pull request #10613 from vrothberg/v3.2-vendor-common
[v3.2] vendor containers/common@v0.38.7
2021-06-09 15:41:45 -04:00
f2b3da5025 [v3.2] vendor containers/common@v0.38.7
* libimage: pull: turn image-lookup errors non-fatal

Prevents https://bugzilla.redhat.com/show_bug.cgi?id=1966872 from being
introduced with v3.2.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-09 15:37:56 +02:00
d22b54442e Merge pull request #10605 from baude/3.2hvf
Correct qemu options for Intel macs
2021-06-09 11:09:52 +02:00
b0eeca695d Merge pull request #10608 from vrothberg/v3.2-vendor-common
[v3.2] vendor containers/common@v0.38.6
2021-06-09 11:04:51 +02:00
78430ee1d4 [v3.2] vendor containers/common@v0.38.6
Fixes the seccomp-profile regression in v3.2

Fixes: #10556
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-09 09:22:01 +02:00
b6ef7cf21d Correct qemu options for Intel macs
On intel macs, we need to accel=hvf to work correctly.

Fixes: #10555

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-06-08 13:45:07 -05:00
c7e96edfb2 Merge pull request #10552 from mheon/bump_320
Bump to v3.2.0
2021-06-03 22:00:47 +02:00
9647d88449 Ensure minimum API version is set correctly in tests
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-03 14:46:04 -04:00
72455ece42 Bump to v3.2.1-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-03 14:10:39 -04:00
0281ef262d Bump to v3.2.0
Signed-off-by: Matthew Heon <mheon@redhat.com>
v3.2.0
2021-06-03 14:10:39 -04:00
cff73766fc Fix network create macvlan with subnet option
Creating a macvlan network with the subnet or ipRange option should set
the ipam plugin type to `host-local`. We also have to insert the default
route.

Fixes #10283

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-06-03 14:10:39 -04:00
8688f54eac Final release notes updates for v3.2.0
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-03 14:10:39 -04:00
f62c6bf6ec add ipv6 nameservers only when the container has ipv6 enabled
The containers /etc/resolv.conf allways preserved the ipv6 nameserves
from the host even when the container did not supported ipv6. Check
if the cni result contains an ipv6 address or slirp4netns has ipv6
support enabled and only add the ipv6 nameservers when this is the case.

The test needs to have an ipv6 nameserver in the hosts /etc/hosts but we
should never mess with this file on the host. Therefore the test is
skipped when no ipv6 is detected.

Fixes #10158

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-03 13:56:48 -04:00
4b8ca63039 Use request context instead of background
This prevents goroutine leak:
If background context were used then push operation would continue even
if client aborted request by closing connection.

[NO TESTS NEEDED]

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-06-03 13:54:57 -04:00
326c758bfd Merge pull request #10534 from vrothberg/v3.2-fix-10507
[v.3.2] events: support disjunctive filters
2021-06-02 23:26:55 +02:00
ce5c3b5543 [v.3.2] events: support disjunctive filters
While different filters are applied in conjunction, the same filter (but
with different values) should be applied in disjunction.  This allows,
for instance, to query the events of two containers.

Fixes: #10507
Backport-of: commit 37f39eefee72ec4fb6c6bd71642e9d384c448387
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-02 16:38:54 +02:00
4b202ae29b Merge pull request #10532 from edsantiago/mount_colon_z
[v3.2] System tests: add :Z to volume mounts
2021-06-02 10:29:59 -04:00
dd83f5c0cd System tests: add :Z to volume mounts
selinux-policy-34.9-1.fc34 breaks a behavior we've relied on
since (at least) January 2020:

   - Revert "Add permission open to files_read_inherited_tmp_files()
     interface"

That's probably the correct thing to do, but it breaks our
existing tests. Solution: add ':Z' where needed.

Tested on Ed's laptop, which has the offending selinux-policy
as of 2021-05-31. Tests pass root and rootless. (I mention
this because tests will obviously pass in CI, which has a
much older selinux-policy).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-06-02 05:19:20 -06:00
96c0aa688b Merge pull request #10509 from vrothberg/v3.2-cherry-pick-53072184192e9952daa3a84bc6f55c15e9ea352e
[v3.2] generate systemd: make mounts portable
2021-06-01 19:00:48 +02:00
32927f5d66 generate systemd: make mounts portable
Commit 748826fc88fc fixed a bug where slow mounting of the runroot was
causing issues when the units are started at boot.  The fix was to add
the container's runroot to the required mounts; the graph root has been
added as well.

Hard-coding the run- and graphroot to the required mounts, however,
breaks the portability of units generated with --now.  Those units are
intended to be running on any machine as, theoreticaly, any user.

Make the mounts portable by using the `%t` macro for the run root.
Since the graphroot's location varies across root and ordinary users,
drop it from the list of required mounts.  The graphroot was not causing
issues.

Fixes: #10493
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-31 14:56:45 +02:00
ba1dac7405 Merge pull request #10505 from vrothberg/v3.2-vendor-storage
vendor containers/storage@v1.31.3
2021-05-31 13:51:33 +02:00
abb57e5cf4 vendor containers/storage@v1.31.3
* store: ReloadIfChanged propagates errors from Modified()
* store: load additional image stores once
* store: fix graphLock reload

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-31 09:56:56 +02:00
6f28b151b6 Merge pull request #10484 from vrothberg/3.2-vendor-common
vendor containers/common@v0.38.5
2021-05-27 13:00:08 -04:00
1e45631829 vendor containers/common@v0.38.5
* pull: don't resolve short names on explicit docker:// reference

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-27 15:35:37 +02:00