Commit graph

13064 commits

Author SHA1 Message Date
OpenShift Merge Robot
b8fde5c5b2
Merge pull request #12549 from mheon/bump_344
Bump to v3.4.4
2021-12-08 20:02:19 +00:00
Matthew Heon
d46a82d218 Bump to v3.4.5-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-08 13:41:37 -05:00
Matthew Heon
f6526ada10 Bump to v3.4.4
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-08 13:41:11 -05:00
Matthew Heon
c6989d06d3 Update release notes for v3.4.4
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-08 13:40:44 -05:00
Aditya Rajan
e30588a685 specgen: honor empty args for entrypoint
Users should be able to override containers entrypoint using
`--entrypoint ""` following works fine for podman but not for podman
remote.

Specgen ignores empty argument for entrypoint so make specgen honor
empty arguments.

Signed-off-by: Aditya Rajan <arajan@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-08 13:39:10 -05:00
Aditya Rajan
db9caa74b7 volume: apply exact permission of target directory without adding extra 0111
While trying to match permissions of target directory podman adds
extra `0111` which should not be needed if target path does not have
execute permission.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-08 13:34:55 -05:00
OpenShift Merge Robot
2d7c4beffc
Merge pull request #12546 from edsantiago/fix_failing_tests
[3.4] Fix failing tests
2021-12-08 16:26:20 +00:00
Valentin Rothberg
921e9ecbb3 fix remote run/start flake
Fix the flake reported in #9597 with a workaround to at least stop
wasting energy until the root cause has been found and fixed.

It seems that a remote run returns before the container has transitioned
into the `exited` state which ultimately breaks a subsequent remote
start with attach.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-08 07:54:18 -07:00
Ed Santiago
9bf0271e6d Disable stty system test
It's failing pretty reliably now, so much so that gating tests
will be unlikely to pass.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-08 07:52:57 -07:00
OpenShift Merge Robot
7472aa112a
Merge pull request #12540 from edsantiago/backport_movetocgroup
[v3.4] backport: utils: reintroduce moveToCgroup
2021-12-08 14:38:17 +00:00
Giuseppe Scrivano
2ddd2b76b6 utils: reintroduce moveToCgroup
commit ee62711136 introduced the
regression.

It was mistakenly removed as part of a cleanup, but this code is
needed by another code path, where we move conmon for the exec session
to the same cgroup used by conmon for the process.

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

[NO NEW TESTS NEEDED] it fixes a regression in the CI

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-08 04:54:49 -07:00
OpenShift Merge Robot
49f589d7c3
Merge pull request #12525 from mheon/bump_343
Backports for and bump to v3.4.3
2021-12-06 23:43:25 +00:00
Matthew Heon
014bbdb40a Add library bumps to release notes
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-06 16:00:44 -05:00
Matthew Heon
50bc223a2c Bump to v3.4.4-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-06 15:55:43 -05:00
Matthew Heon
3450a60d21 Bump to v3.4.3
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-06 15:54:55 -05:00
Matthew Heon
b93e3369ad Final release notes for v3.2.3
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-06 15:54:30 -05:00
Jason T. Greene
a21c5d184e Escape trailing slash in install directory location so the closing quote is not escaped
Fixes #11416 [NO NEW TESTS NEEDED]

Signed-off-by: Jason Greene <jason.greene@redhat.com>
2021-12-06 15:52:40 -05:00
Miloslav Trmač
0657204161 Improve documentation of (podman image save --format)
- Don't pointlessly repeat the names
- Improve documentation of the formats
- Use a table, per MANPAGE_SYNTAX.md

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-12-06 15:50:53 -05:00
Miloslav Trmač
7dbe5508bb Ensure the generated NodePort values are unique
... at least within a single service.

[NO NEW TESTS NEEDED]
because testing RNGs is problematic. (We _could_
probably inject a mock RNG implementation that always
returns the same value, or something like that.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-12-06 15:48:51 -05:00
Miloslav Trmač
bb1293133d Allow containerPortsToServicePorts to fail
Add an error return to it and affected callers.

Should not affect behavior, the function can't currently fail.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-12-06 15:48:44 -05:00
Miloslav Trmač
25e5e8f89e Don't use the global math/rand RNG for service ports
Use a private RNG with the desired seed, don't interfere
with the other uses.

Introducing the servicePortState type is rather overkill
for the single member, but we'll add another one immediately.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-12-06 15:48:38 -05:00
Miloslav Trmač
d2602039e7 Move a comment to the relevant place
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-12-06 15:48:31 -05:00
Valentin Rothberg
d952763884 compat: images/json
Do not list manifest lists.  Docker doesn't either.

Fixes: #12453
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-06 15:47:04 -05:00
Shion Tanaka
658d133390 Fixed the containerfile not found during remote build.
[NO NEW TESTS NEEDED]

Signed-off-by: Shion Tanaka <shtanaka@redhat.com>
2021-12-06 15:44:14 -05:00
Giuseppe Scrivano
aa9799b81f container, cgroup: detect pid termination
If the /proc/$PID/cgroup file doesn't exist, then it is likely the
container was terminated in the meanwhile so report ErrCtrStopped that
is already handled instead of ENOENT.

commit a66f40b4df introduced the regression.

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

[NO NEW TESTS NEEDED] it solves a race in the CI that is difficult to reproduce.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-06 15:39:38 -05:00
Valentin Rothberg
39318f1779 top: parse ps(1) args correctly
The arguments of ps(1) should be shlexed.

Fixes: #12452
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-06 15:38:10 -05:00
Daniel J Walsh
e1cf9d4c28 Only open save output file with WRONLY
The previous code fails on a MAC when opening /dev/stdout

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

[NO NEW TESTS NEEDED] No easy way to test this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-06 15:35:50 -05:00
Daniel J Walsh
e2d6948157 List /etc/containers/certs.d as default for --cert-path
Helps Document https://github.com/containers/podman/issues/10116

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-06 15:35:19 -05:00
Daniel J Walsh
75fc7e43e0 Move the chown to after the ADDs
I have noticed that the containers.conf file in the /home/podman
directory is owned by root and not Podman. This change fixes the
ownership.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-06 15:34:37 -05:00
Aditya Rajan
ab5ca6f759 compat: Add compatiblity with Docker/Moby API for scenarios where build fails
In order to maintain compatiblity with `moby API` we must the field
`errorDetail` which is primary error reporting field with stream.

Currently podman is using `error` which is already deprecated by moby.

Check: https://github.com/moby/moby/blob/master/pkg/jsonmessage/jsonmessage.go#L147

[NO NEW TESTS NEEDED]
We can't test this in podman CI since we dont have a docker client.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-06 15:33:29 -05:00
Matej Vasek
7b8e66de0b fix: parsing of HostConfig.Mounts for container create
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-12-06 15:32:15 -05:00
Matej Vasek
741d98fade fix: error reporting for archive endpoint
Returning 500 when copying to read-only destination.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-12-06 15:27:55 -05:00
Giuseppe Scrivano
905eabf0be libpod: improve heuristic to detect cgroup
improve the heuristic to detect the scope that was created for the container.
This is necessary with systemd running as PID 1, since it moves itself
to a different sub-cgroup, thus stats would not account for other
processes in the same container.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-06 15:26:18 -05:00
Giuseppe Scrivano
e3a50e7609 libpod, inspect: export cgroup path
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-06 15:25:07 -05:00
Giuseppe Scrivano
5f9f3bbea0 stats: get the memory limit from the spec
OCI runtimes may set the memory limits in different ways, e.g., crun
creates a sub-cgroup where the limits are applied, while runc applies
them directly on the created cgroup.  Since there is standardization
on the cgroup path to use, just use the limit specified in the spec
file.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-06 15:25:00 -05:00
Aditya Rajan
05a5fcb45b oci: ack crun output when container is not there
`crun status ctrid` outputs `No such file or directory` when container
is not there so podman much ack it.

[NO NEW TESTS NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-06 15:20:28 -05:00
Aditya Rajan
c5530591bb oci: exit gracefully if container is already dead
While trying to kill a container with a `signal` we cant do anything if
container is already dead so `exit` gracefully instead of trying to
delete container again. Get container status from runtime.

[ NO NEW TESTS NEEDED ]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-06 15:20:21 -05:00
Urvashi Mohnani
4a7af72ea9 Add note about volume with unprivileged container
Add a note to the generated kube yaml if we detect a
volume is being mounted. The note lets the user know
what needs to be done to avoid permission denied error
when trying to access the volume for an unprivileged
container.
Add the same note to the man pages.

NO NEW TESTS NEEDED

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-12-06 15:17:57 -05:00
Aditya Rajan
ca518ecdee swagger: add layers to build api docs
Add missing `layer` entry to swagger docs for `/build`.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-06 15:16:10 -05:00
Aditya Rajan
a10963f2e5 compat: add layer caching compatiblity for non podman clients
Non-podman clients do not set `layers` while making request. This is
supposed to be `true` bydefault but `non-podman-clients i.e Docker` dont
know about this field as a result they end up setting this values to
`false`. Causing builds to never use cache for layers.

Adds compatiblity for `docker SDK`.

[NO NEW TESTS NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-06 15:16:03 -05:00
Paul Holzinger
4f58790488 fix duplicated logs command
Podman logs was defined twice, once for container logs and once for pod
logs. This causes problems with the shell completion. Also podman --help
showed this command twice.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-06 15:12:49 -05:00
Michael Scherer
2c7b673c5c Change error message for compatibility with docker
Fix #12315

Signed-off-by: Michael Scherer <misc@redhat.com>
2021-12-06 15:11:08 -05:00
Paul Holzinger
76fd7dbd15 podman machine start wait for ssh
Wait for sshd to be ready before we return from start. This should make
podman machine ssh immediately available without any race conditions.

Fixes #11532

[NO NEW TESTS NEEDED] I could not reproduce the issue so I am not sure
if this fixes it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-06 15:03:07 -05:00
etenzy
0282f98b3c fix: take absolute path for dd on apple silicon
Fixes #12329

[NO NEW TESTS NEEDED] podman machine

Signed-off-by: Michael Rödel <hello@mroedel.de>
2021-12-06 15:00:47 -05:00
Giuseppe Scrivano
b5ded05f98 rootless: drop strerror(errno) calls
*printf functions already support printing the errno string with %m

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-06 15:00:29 -05:00
Giuseppe Scrivano
a92b71333e rootless: reuse existing open_namespace function
there is already a function for opening a namespace path, reuse it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-06 15:00:23 -05:00
Giuseppe Scrivano
8e6ee43bb2 rootless: use auto cleanup functions
simplify code using auto cleanup functions

[NO NEW TESTS NEEDED] it is a refactoring of existing code

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-06 15:00:16 -05:00
Hironori Shiina
6d9c1d8fdc Set flags to test 'logs -f' with journald driver
`logs -f` with `journald` is supported only when `journald` events
backend is used. To pass system tests using `logs -f` in an environment
where `events_logger` is not set to `journald` in `containers.conf`,
this fix sets `--events-backend` or `--log-driver` temporally.

Signed-off-by: Hironori Shiina <shiina.hironori@jp.fujitsu.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-12-06 14:53:27 -05:00
Aditya Rajan
db6b9131ef secret: honor custom target for secrets with run
Honor custom `target` if specified while running or creating containers
with secret `type=mount`.

Example:
`podman run -it --secret token,type=mount,target=TOKEN ubi8/ubi:latest
bash`

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-06 14:37:46 -05:00
Nalin Dahyabhai
08bcd60c8f journald logs: keep reading until the journal's end
When reading logs from the journal, keep going after the container
exits, in case it gets restarted.

Events logged to the journal via the normal paths don't include
CONTAINER_ID_FULL, so don't bother adding it to the "history" event we
use to force at least one entry for the container to show up in the log.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-12-06 14:34:25 -05:00