11941 Commits

Author SHA1 Message Date
4136f8bdc9 Merge pull request #10915 from ashley-cui/backport
[3.2] Backport: Support uid,gid,mode options for secrets
2021-07-13 10:50:45 -04:00
6f9d9636a2 Support uid,gid,mode options for secrets
Support UID, GID, Mode options for mount type secrets. Also, change
default secret permissions to 444 so all users can read secret.

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-07-12 17:00:50 -04:00
60d12f72b9 Merge pull request #10871 from vrothberg/3.2-vendor-common
[3.2] vendor containers/common@v0.38.15
2021-07-09 05:46:05 -04:00
bed195bf8c vendor containers/common@v0.38.15
* libimage: import: fix tags
* Don't use systemd defaults if /proc/1/comm != systemd

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1979497
Fixes: containers/podman/issues/10854
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-08 10:56:35 +02:00
275b0d8263 Merge pull request #10869 from vrothberg/3.2-backports
[CI:DOCS] [3.2] podman search: clarify that results depend on implementation
2021-07-08 04:48:10 -04:00
75431a455f [CI:DOCS] podman search: clarify that results depend on implementation
Clarify in the man page that podman-search is not generally realiable
way of determining the presence/existence of an image.  The results of
the v1 and the v2 endpoints depend on the implementation of each
registry; the semantics are not really specified.  Some registries may
not support search at all as it's not part of the OCI dist spec.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1978556
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-07 11:04:40 +02:00
6f0bf16c83 Merge pull request #10845 from vrothberg/3.2-backports
[3.2] vendor containers/common@v0.38.14
2021-07-02 10:49:05 -04:00
37570b7b75 vendor containers/common@v0.38.14
Fix looking up images with other architectures.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1978556
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-02 11:46:27 +02:00
ac740c649b Merge pull request #10830 from vrothberg/3.2-backports
[3.2] vendor containers/common@v0.38.13
2021-07-01 09:56:00 -04:00
6ecedc1618 vendor containers/common@v0.38.13
* libimage: events: deferred write

Fixes: bugzilla.redhat.com/show_bug.cgi?id=1977673
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-01 11:27:04 +02:00
fbb4e5ebc8 Merge pull request #10808 from vrothberg/3.2-backports
[3.2] vendor containers/common@v0.38.12
2021-06-29 06:10:05 -04:00
8a41bf3ee6 [3.2] vendor containers/common@v0.38.12
* pull: custom platform: do not use local image name

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-29 10:41:45 +02:00
a2765155ee Merge pull request #10784 from mheon/release_322
[CI:DOCS] Bump to v3.2.2
2021-06-25 17:00:09 -04:00
2c003d9783 Bump README to v3.2.2
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-25 16:33:23 -04:00
bb2cbf0d55 Bump to v3.2.3-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-25 14:24:32 -04:00
d577c44e35 Bump to v3.2.2
Signed-off-by: Matthew Heon <mheon@redhat.com>
v3.2.2
2021-06-25 14:21:29 -04:00
dec14194f0 Merge pull request #10778 from mheon/backports_322
Backports for v3.2.2
2021-06-25 11:08:43 -04:00
9f4afa1ea2 fix systemcontext to use correct TMPDIR
Users are complaining about read/only /var/tmp failing
even if TMPDIR=/tmp is set.

This PR Fixes: https://github.com/containers/podman/issues/10698

[NO TESTS NEEDED] No way to test this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-25 09:35:34 -04:00
5dabff27db Scrub podman commands to use report package
Refactor podman commands that have drifted from using
c/common report pkg. Report pkg is needed to implement
go template functions.

Removed obsolete code from podman which exists in c/common.

Latest template library added default newlines and method to
remove them. Incorporated needed changes in c/common PR below.

Depends on https://github.com/containers/common/pull/624
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1855983

Signed-off-by: Jhon Honce <jhonce@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-25 09:33:06 -04:00
647c2024e2 Fix volumes with uid and gid options
Podman uses the volume option map to check if it has to mount the volume
or not when the container is started. Commit 28138dafcc39 added to uid
and gid options to this map, however when only uid/gid is set we cannot
mount this volume because there is no filesystem or device specified.
Make sure we do not try to mount the volume when only the uid/gid option
is set since this is a simple chown operation.

Also when a uid/gid is explicity set, do not chown the volume based on
the container user when the volume is used for the first time.

Fixes #10620

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-25 09:32:22 -04:00
c2dcb3ee24 Vendor in c/common v0.38.11
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-25 09:31:50 -04:00
ba70363f69 Initial release notes for v3.2.2
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-24 14:14:09 -04:00
a9fd54775d Fix restoring of privileged containers
Checkpointed containers started with --privileged fail during restore
with:

 Error: error creating container storage: ProcessLabel and Mountlabel must either not be specified or both specified

This commit fixes it by not setting the labels when restoring a
privileged container.

[NO TESTS NEEDED]

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-06-24 14:11:59 -04:00
d5f0729b23 Fix handling of podman-remote build --device
Fixes: https://github.com/containers/podman/issues/10614

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-06-24 14:10:42 -04:00
90805fa39f Add support for podman remote build -f - .
Fixes: https://github.com/containers/podman/issues/10621

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-06-24 14:08:57 -04:00
854c27c0a0 Fix panic condition in cgroups.getAvailableControllers
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2021-06-24 14:07:10 -04:00
b0dc157af9 Fix permissions on initially created named volumes
Permission of volume should match the directory it is being mounted on.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-06-24 14:05:12 -04:00
f5cdb95eec Fix building static podman-remote
As near as I can tell, sometime between `v1.6.4` and `v1.9` the definition
of `LDFLAGS_PODMAN_STATIC` was both created and lost.  Additionally, after
a refactoring of the `Makefile` it was possible to enable CGO (which
will cause a dynamic binary to be built).  Fix both issues by adding the
missing definition and forcing CGO to be disabled.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-06-24 14:03:26 -04:00
1c04cfe837 add correct slirp ip to /etc/hosts
The container name should have the slirp interface ip set in /etc/hosts
and not the gateway ip. Commit c8dfcce6db0a introduced this regression.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1972073

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-24 14:00:23 -04:00
6c4ee8535f disable tty-size exec checks in system tests
As discussed in #10710, the additional checks for podman-exec added by
commit 666f555aa52b are extremely flaky and appear in nearly every PR
I have see this week.

Let's temporarily disable the checks and reenable them on #10710 is
fixed.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-24 13:50:29 -04:00
6ba9617be6 Fix resize race with podman exec -it
When starting a process with `podman exec -it` the terminal is resized
after the process is started. To fix this allow exec start to accept the
terminal height and width as parameter and let it resize right before
the process is started.

Fixes #10560

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-24 13:48:48 -04:00
eb6d4b0cfe Fix documentation of the --format option of podman push
It affects all transports; and without --format, we try several manifest formats.

[NO TESTS NEEDED]

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-06-24 13:47:21 -04:00
e5c939183a Fix systemd-resolved detection.
Previously podman failed when run in an environment where 127.0.0.53 is
the only nameserver but systemd-resolved is not used directly.
In practice this happened when podman was run within an alpine container
that used the host's network and the host was running systemd-resolved.

This fix makes podman ignore a file not found error when reading /run/systemd/resolve/resolv.conf.

Closes #10733

[NO TESTS NEEDED]

Signed-off-by: Max Goltzsche <max.goltzsche@gmail.com>
2021-06-24 13:43:40 -04:00
613f427a03 Health Check is not handled in the compat LibpodToContainerJSON
Added parsing and handling for the healthCheck status within containers.go. Also modified tests

fixes #10457

Signed-off-by: cdoern <cbdoer23@g.holycross.edu>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-06-24 13:42:13 -04:00
949573c5a8 Do not use inotify for OCICNI
Podman does not need to watch the cni config directory. If a network is
not found in the cache, OCICNI will reload the networks anyway and thus
even podman system service should work as expected.
Also include a change to not mount a "new" /var by default in the
rootless cni ns, instead try to use /var/lib/cni first and then the
parent dir. This allows users to store cni configs under /var/... which
is the case for the CI compose test.

[NO TESTS NEEDED]

Fixes #10686

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-24 13:39:24 -04:00
ab5e770c4b getContainerNetworkInfo: lock netNsCtr before sync
`syncContainer()` requires the container to be locked, otherwise we can
end up with undefined behavior.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-24 13:38:07 -04:00
b957bff8b5 [NO TESTS NEEDED] Create /etc/mtab with the correct ownership
Create the /etc and /etc/mtab directories with the
correct ownership based on what the UID and GID is
for the container. This was causing issue when starting
the infra container with userns as the /etc directory
wasn't being created with the correct ownership.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-06-24 13:32:06 -04:00
6d394f0e47 Create the /etc/mtab file if does not exists
We should create the /etc/mtab->/proc/mountinfo link
so that mount command will work within the container.

Docker does this by default.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-06-24 13:30:50 -04:00
f8a793a72d Merge pull request #10775 from vrothberg/3.2-fix-cp
[v3.2] cp: do not allow dir->file copying
2021-06-24 10:35:12 -04:00
879d66e7db [v3.2] cp: do not allow dir->file copying
Fix a bug in `podman-cp` to forbid copying directories to files.
Previously, the directory was copied to the parent directory of the file
which is wrong.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-24 14:58:11 +02:00
3ee967bd5d Merge pull request #10763 from vrothberg/3.2-backports
3.2 backports
2021-06-24 05:40:08 -04:00
6f769bc0e9 create: support images with invalid platform
Much to my regret, there is a number of images in the wild with invalid
platforms breaking the platform checks in libimage that want to make
sure that a local image is matching the expected platform.

Imagine a `podman run --arch=arm64 fedora` with a local amd64 fedora
image.  We really shouldn't use the local one in this case and pull down
the arm64 one.

The strict platform checks in libimage in combination with invalid
platforms in images surfaced in Podman being able to pull an image but
failing to look it up in subsequent presence checks.  A `podman run`
would hence pull such an image but fail to create the container.

Support images with invalid platforms by vendoring the latest HEAD from
containers/common.  Also remove the partially implemented pull-policy
logic from Podman and let libimage handle that entirely.  However,
whenever --arch, --os or --platform are specified, the pull policy will
be forced to "newer".  This way, we pessimistically assume that the
local image has an invalid platform and we reach out to the registry.
If there's a newer image (i.e., one with a different digest), we'll pull
it down.

Please note that most of the logic has either already been implemented
in libimage or been moved down which allows for removing some clutter
from Podman.

[NO TESTS NEEDED] since c/common has new tests.  Podman can rely on the
existing tests.

Fixes: #10648
Fixes: #10682
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-24 10:15:56 +02:00
19a89db661 vendor containers/common@v0.38.10
Please refer to the individual commits for further details:

* libimage: pull: override even --pull=never with custom platfo
* libimage: pull: enforce pull policy for custom platforms
* libimage: pull: ignore platform for local image lookup
* Allow /etc/containers/containers.conf to be read by non-root
* [0.38] libimage: force remove: only untag on multi tag image

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-24 08:47:48 +02:00
7d8f111245 Merge pull request #10744 from vrothberg/v3.2-fix-10682
[v3.2]  logs: k8s-file: restore poll sleep
2021-06-22 09:14:07 -04:00
e5c070baff logs: k8s-file: restore poll sleep
Commit 84b55eec2796 attempted to fix a race waiting for the container
died event.  Previously, Podman slept for duration of the polling
frequence which I considerred to be a mistake.  As it turns out, I was
mistaken since the file logger will, in fact, NOT read until EOF and
then stop logging but stop logging immediately _after_ it woke up.

[NO TESTS NEEDED] as the race condition cannot be hit reliably.

Fixes: #10675
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-22 13:18:04 +02:00
4d9a9149dd logs: k8s-file: fix spurious error logs
Fix the suprious "Error: nil" messages.  Also add some more context to
logged error messages which makes error sources more obvious.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-22 13:18:04 +02:00
017116242d Merge pull request #10751 from vrothberg/v3.2-backport-969cc3237be5
[v3.2] utils: move message from warning to debug
2021-06-22 07:17:08 -04:00
dac2d31a24 utils: move message from warning to debug
if a pid could not be moved to a new cgroup, print a debug message
instead of a warning.

Backport of commit 969cc3237be5.

[NO TESTS NEEDED]

Closes: https://github.com/containers/podman/issues/10674
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-06-22 11:18:46 +02:00
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