19579 Commits

Author SHA1 Message Date
f8213a6d53 libpod: don't make a broken symlink for /etc/mtab on FreeBSD
This file has not been present in BSD systems since 2.9.1 BSD and as far
as I remember /proc/mounts has never existed on BSD systems.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-07-10 12:41:41 +01:00
499b8d13c5 CI: remove build without cgo task
Podman is basically unusable without cgo, checking if it compiles
without adds no value and just tricks people into thinking it works when
it does not.

This means we do not need extra to NOP out a lot of cgo calls with
functions that just return an error like `XXX is not supported without
cgo`.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-10 13:33:03 +02:00
42ea0bf9c7 libpod: use io.Writer vs io.WriteCloser for attach streams
We never ever close the stream so we do not need the Close() function in
th ebackend, the caller should close when required which may no be the
case, i.e. when os.Stdout/err is used.
This should not be a breaking change as the io.Writer is a subset of
io.WriteCloser, therfore all code should still compile while allowing to
pass in Writers without Close().

This is useful for podman top where we exec ps in the container via
podman exec.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-10 13:33:03 +02:00
597ebeb60f top: do not depend on ps(1) in container
This ended up more complicated then expected. Lets start first with the
problem to show why I am doing this:

Currently we simply execute ps(1) in the container. This has some
drawbacks. First, obviously you need to have ps(1) in the container
image. That is no always the case especially in small images. Second,
even if you do it will often be only busybox's ps which supports far
less options.

Now we also have psgo which is used by default but that only supports a
small subset of ps(1) options. Implementing all options there is way to
much work.

Docker on the other hand executes ps(1) directly on the host and tries
to filter pids with `-q` an option which is not supported by busybox's
ps and conflicts with other ps(1) arguments. That means they fall back
to full ps(1) on the host and then filter based on the pid in the
output. This is kinda ugly and fails short because users can modify the
ps output and it may not even include the pid in the output which causes
an error.

So every solution has a different drawback, but what if we can combine
them somehow?! This commit tries exactly that.

We use ps(1) from the host and execute that in the container's pid
namespace.
There are some security concerns that must be addressed:
- mount the executable paths for ps and podman itself readonly to
  prevent the container from overwriting it via /proc/self/exe.
- set NO_NEW_PRIVS, SET_DUMPABLE and PDEATHSIG
- close all non std fds to prevent leaking files in that the caller had
  open
- unset all environment variables to not leak any into the contianer

Technically this could be a breaking change if somebody does not
have ps on the host and only in the container but I find that very
unlikely, we still have the exec in container fallback.

Because this can be insecure when the contianer has CAP_SYS_PTRACE we
still only use the podman exec version in that case.

This updates the docs accordingly, note that podman pod top never falls
back to executing ps in the container as this makes no sense with
multiple containers so I fixed the docs there as well.

Fixes #19001
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2215572

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-10 13:32:55 +02:00
3f8ee70d0c make --syslog errors non fatal
Podman will always pass down --syslog to conmon since 13c2aca21.
However there systems without syslog running, likely in container
setups. As reported in this was already a problem before when debug
level is used. Then conmon will pass down --syslog back to the podman
container cleanup command causing it to fail without doing anything.
Given that I think it is better to just ignore the error and log it on
debug level, we need to make sure cleanup works consistently.

[NO NEW TESTS NEEDED]

Fixes #19075

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-10 11:45:59 +02:00
7cd1fb77f9 Merge pull request #19172 from eriksjolund/fix_underscore_in_man_page
[CI:DOCS] uidmap man pages: fix corrupt italics
2023-07-10 05:30:58 -04:00
b713fe3997 Merge pull request #19174 from mhrivnak/fix-quadlet-docs
[CI:DOCS] Fixes typo in the path where quadlet looks for files
2023-07-10 05:20:23 -04:00
dbec2b5aa2 api: fix doc for default ps_args
The libpod API does not set a default. Also PodTop is podman sepecific
so we can just rmeove this extra branch there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-10 10:14:07 +02:00
1b7eb44d3b Fixes typo in the path where quadlet looks for files
This change matches the list above in the same document, in the section
`Podman user unit search path`. I also confirmed that this matches [the
code](https://github.com/containers/podman/blob/60a5a59/cmd/quadlet/main.go#L119).

Signed-off-by: Michael Hrivnak <mhrivnak@hrivnak.org>
2023-07-09 15:53:56 -04:00
efefd8cf5b Add --replace flag to podman secret create
Users may want to replace the secret used within containers, without
destroying the secret and recreating it.

Partial fix for https://github.com/containers/podman/issues/18667

Make sure podman --remote secret inspect and podman secret inspect
return the same error message.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-09 07:26:09 -04:00
5d706eb027 Merge pull request #19084 from eriksjolund/add_docs_to_system_service
[CI:DOCS] podman-system-service.1.md: document systemd usage
2023-07-09 07:22:17 -04:00
478cd66cd3 Merge pull request #19134 from containers/renovate/golang.org-x-net-0.x
fix(deps): update module golang.org/x/net to v0.12.0
2023-07-09 07:17:08 -04:00
914752614a Merge pull request #19168 from containers/renovate/github-issue-labeler-3.x
[skip-ci] Update github/issue-labeler action to v3.2
2023-07-09 07:14:33 -04:00
05a420bc8b Merge pull request #19163 from containers/renovate/github.com-docker-docker-24.x
fix(deps): update module github.com/docker/docker to v24.0.4+incompatible
2023-07-09 07:11:57 -04:00
eec438222a [CI:DOCS] uidmap man pages: fix corrupt italics
The markdown-to-manpage sequence interprets
_from_uid_ and *from_uid* differently.
Use the latter syntax to get the expected result.

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

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-09 10:50:48 +02:00
8d24e28387 [skip-ci] Update github/issue-labeler action to v3.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-08 19:44:36 +00:00
f9077689ea [CI:DOCS] podman-system-service.1.md: document systemd usage
Regarding "The command does not support more than one listening socket for the API service."
See this Podman source code: (a permalink into the main branch as of 2 July 2023)
539be58163/cmd/podman/system/service_abi.go (L48-L50)

Move up the paragraph "The REST API provided ...".

Move up the sentence "Note: The default systemd ...".

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-08 18:17:02 +02:00
dd16661b1f fix(deps): update module github.com/docker/docker to v24.0.4+incompatible
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-07 22:44:44 +00:00
94dba6d891 Merge pull request #19150 from containers/renovate/github.com-docker-docker-24.x
fix(deps): update module github.com/docker/docker to v24.0.3+incompatible
2023-07-07 08:27:48 -04:00
46f9cf7e83 Merge pull request #19146 from afbjorklund/bytes-size
Use bytes size consistently instead of human size
2023-07-07 07:17:37 -04:00
65136521e0 fix(deps): update module github.com/docker/docker to v24.0.3+incompatible
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-06 17:46:21 +00:00
28abed6e2e Merge pull request #19145 from Luminger/fix-range-option-parsing
bugfix: do not try to parse empty ranges
2023-07-06 10:13:43 -04:00
fa654e9857 Use bytes size consistently instead of human size
Previously podman was using "MB" and "GB" (binary) for input but
"MB" and "GB" (decimal) for output, which was causing confusion.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2023-07-06 14:51:06 +02:00
b721f96f5b Merge pull request #19074 from dfr/freebsd-build-test
Cirrus: change FreeBSD CI build to run in a VM
2023-07-06 08:06:38 -04:00
fce2164601 Merge pull request #19137 from containers/renovate/golang.org-x-tools-0.x
fix(deps): update module golang.org/x/tools to v0.11.0
2023-07-06 07:58:56 -04:00
dee94ea699 bugfix: do not try to parse empty ranges
An empty range caused a panic as parseOptionIDs tried to check further
down for an @ at index 0 without taking into account that the splitted
out string could be empty.

Signed-off-by: Simon Brakhane <simon@brakhane.net>
2023-07-06 11:16:34 +02:00
972e4ae76d Merge pull request #19117 from lsm5/packit-golist
[CI:BUILD] Packit: fix pre-sync action for downstream tasks
2023-07-06 05:06:13 -04:00
f1775a34ab Merge pull request #19116 from vrothberg/qemu-backoffs
machine start: qemu: adjust backoffs
2023-07-06 02:57:47 -04:00
9e40457687 [CI:BUILD] Packit: fix pre-sync action for downstream tasks
One of the reasons the last propose-downstream task failed for Fedora
was the `golist` tool wasn't available in the Packit environment.

This commit adds golist to the environment by downloading and extracting
the golist rpm.

This dependency could've been added in packit's upstream config but
there were a few blockers, so it's easiest to add them in our action
script.

Ref: https://github.com/containers/podman/issues/19094

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-07-05 14:24:00 -04:00
531fb21d03 fix(deps): update module golang.org/x/tools to v0.11.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 17:43:10 +00:00
ab2fa45ad6 fix(deps): update module golang.org/x/net to v0.12.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 16:16:41 +00:00
7c04d6dddc Merge pull request #19129 from containers/renovate/golang.org-x-term-0.x
fix(deps): update module golang.org/x/term to v0.10.0
2023-07-05 12:15:00 -04:00
904997999e Merge pull request #19127 from edsantiago/fix_toolbox_flake
e2e: fix two toolbox flakes
2023-07-05 10:34:21 -04:00
459b1578c6 fix(deps): update module golang.org/x/term to v0.10.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-07-05 14:07:26 +00:00
485de41a3b Merge pull request #19099 from cevich/minor_place_holders
[CI:BUILD] Minor: Don't confuse osx-debugging
2023-07-05 10:05:24 -04:00
99f93d55c4 e2e: fix two toolbox flakes
1. toolbox UID/GID allocation: pick numbers < 1500. Otherwise
   we run the risk of colliding with the Cirrus rootless user.

2. WaitContainerReady(): check the results of the last "podman logs"
   before timing out. Otherwise, the user will see "READY" followed
   immediately by "Container is not ready".
   (global bug, not just toolbox, but that's where I discovered it).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-07-05 06:52:13 -06:00
93447e292d Merge pull request #19092 from vrothberg/bz-2218315
auto update: fix usage of --authfile
2023-07-05 08:02:46 -04:00
d25802a0d1 Merge pull request #19118 from Luap99/ginkgo
test/e2e: several fixes
2023-07-05 07:23:50 -04:00
8d46e79e85 Merge pull request #19122 from containers/renovate/golang.org-x-text-0.x
fix(deps): update module golang.org/x/text to v0.11.0
2023-07-05 07:18:41 -04:00
fc5aa9c9ca test/e2e: use GinkgoT().TempDir() over MkdirTemp()
Using GinkgoT().TempDir() will automatically result in the directy to be
cleaned up when the test is done. This should help to prevent leaking
files and we do not need to error check every time.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-05 10:40:26 +02:00
ea8992cb45 test/e2e: use random ImageCacheDir
Like LockTmpDir use a random tmpdir for this directory. Make sure it is
set for all parallel ginkgo processes.

Also GinkgoT().TempDir() will automatcially remove the directory at the
end so we do not need to worry about cleanup.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-05 10:40:24 +02:00
17a06d3431 test/e2e: remove RHEL7 workaround
AFAIK the latest podman will not even run on RHEL 7 anymore, in any case
we do not need these tests to run there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-05 10:39:57 +02:00
bc22aefce6 test/e2e: remove unnecessary code in SynchronizedAfterSuite
This code does not do anything useful beside removing the cache dir.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-05 10:39:46 +02:00
ff77900387 test/e2e: do not use /tmp for podman commands
Using the OS tempdir here is not good. This defaults to /tmp which means
the inital podman test setup uses these paths:
`--root /tmp/root --runroot /tmp/runroot and --tmpdir /tmp`

Thus we create many files directly under /tmp. Also they were never
removed thus leaked out. When running as root and then later as rooltess
this would fail to permission problems.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-05 10:39:02 +02:00
db7cb1dbfc test/tools: vendor ginkgo v2.11
Ginkgo currently logs a warning because the cli version (defnied in
test/tools/go.mod) does not match the library version (defnied in
go.mod).

Simply fix this by updating ginkgo to the latest version.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-05 10:12:44 +02:00
c20612babc test/e2e: write timings directly to file
There is no need to buffer them all into an array then write them once
at the end. Just write directly to the file.

Fixes #19104

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-05 10:12:43 +02:00
f33a3bdc35 Merge pull request #19085 from dfr/emulate-linux
pkg/specgen: properly identify image OS on FreeBSD
2023-07-05 03:50:19 -04:00
a0b7655523 machine start: qemu: adjust backoffs
Make sure that starting a qemu machine uses proper exponential backoffs
and that a single variable isn't shared across multiple backoffs.

DO NOT BACKPORT: I want to avoid backporting this PR to the upcoming 4.6
release as it increases the flakiness of machine start (see #17403). On
my M2 machine, the flake rate seems to have increased with this change
and I strongly suspect that additional/redundant sleep after waiting for
the machine to be running and listening reduced the flakiness.  My hope
is to have more predictable behavior and find the sources of the flakes
soon.

[NO NEW TESTS NEEDED] - still too flaky to add a test to CI.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-05 09:40:33 +02:00
d874790bc6 auto update: fix usage of --authfile
The --authfile flag has been ignored.  Fix that and add a test to make
sure we won't regress another time.  Requires a new --tls-verify flag
to actually test the code.

Also bump c/common since common/pull/1538 is required to correctly check
for updates.  Note that I had to use the go-mod-edit-replace trick on
c/common as c/buildah would otherwise be moved back to 1.30.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2218315
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-05 08:30:39 +02:00
10615e784b Merge pull request #19106 from edsantiago/refactor_registry
system tests: refactor registry code
2023-07-05 02:29:52 -04:00