Commit graph

19442 commits

Author SHA1 Message Date
Martin Pitt
05bcf0bfaa Packit: run cockpit-podman tests in PRs
See https://cockpit-project.org/blog/tmt-cross-project-testing.html

[NO NEW TESTS NEEDED] - quiesce bot, that whole commit *is* a new test

Signed-off-by: Martin Pitt <mpitt@redhat.com>
2023-08-24 17:54:44 +00:00
OpenShift Merge Robot
c1ab6d477a
Merge pull request #19697 from openshift-cherrypick-robot/cherry-pick-19683-to-v4.6
[v4.6] [CI:BUILD] rpm: spdx compatible license field
2023-08-22 10:37:40 -02:30
Lokesh Mandvekar
07549fa82a rpm: spdx compatible license field
The lowercase `and` in the License field isn't compatible with spdx
license format.

This commit replaces all `and` with `AND` in the License field in spec.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-08-22 12:56:07 +00:00
OpenShift Merge Robot
b3113784cd
Merge pull request #19693 from vrothberg/v4.6-backports
[v4.6] vendor c/storage@v1.48.1
2023-08-22 07:08:34 -02:30
Valentin Rothberg
a90f76e65e vendor c/storage@v1.48.1
* Fix a performance issue when calculating diff sizes in overlay
  (https://bugzilla.redhat.com/show_bug.cgi?id=2232308).

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-08-22 09:32:28 +02:00
OpenShift Merge Robot
b14b982e53
Merge pull request #19685 from openshift-cherrypick-robot/cherry-pick-19670-to-v4.6
[v4.6] [CI:BUILD] rpm: depend on man-db
2023-08-21 12:14:27 -02:30
Lokesh Mandvekar
2fe604a9e7 rpm: depend on man-db
Include dependencies in rpm/podman.spec to make it easy for end users to
build podman from source. This way users can install all build
dependencies by running `dnf -y builddep rpm/podman.spec`.

This is not usually noticeable except on container environments where
man-db often isn't installed by default.

Refs:
https://github.com/containers/podman.io/issues/157
https://github.com/containers/podman.io/pull/174

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-08-21 14:17:36 +00:00
OpenShift Merge Robot
95df47517b
Merge pull request #19682 from openshift-cherrypick-robot/cherry-pick-19676-to-v4.6
[v4.6] use container restart policy if user specifies one
2023-08-21 11:18:26 -02:30
Daniel J Walsh
a917a6cfe0 use container restart policy if user specifies one
Fixes: https://github.com/containers/podman/issues/19671

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-21 11:08:57 +00:00
OpenShift Merge Robot
f844797ed1
Merge pull request #19649 from openshift-cherrypick-robot/cherry-pick-19543-to-v4.6
[v4.6] packit: Build PRs into default packit COPRs
2023-08-17 09:25:33 -02:30
OpenShift Merge Robot
99fea2c612
Merge pull request #19653 from openshift-cherrypick-robot/cherry-pick-19647-to-v4.6
[v4.6] [CI:DOCS] podmansh man page UID=3267 is not allowed
2023-08-16 17:08:02 -02:30
Daniel J Walsh
60660046a2 podmansh man page UID=$(id -u lockedu) is not allowed
Switch man page to user USERID instead of UID, since UID environment
variable is set at login, and is not allowed to be changed.

UID=foobar
bash: UID: readonly variable

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-16 19:29:47 +00:00
Martin Pitt
fa0731f4d3 packit: Build PRs into default packit COPRs
Building all PRs of all container projects into the same COPR does not
properly isolate PRs from each other: E.g. a podman PR currently runs
against whichever crun PR was opened/updated last; in other words,
sending a broken crun PR will instantly break tests for all subsequent
podman runs.

To avoid that, change the copr_build configuration to use the packit
default COPRs, which are specific to the particular PR, and disappear
after a few weeks. Projects should only run against what landed in
our dependencies' main branches, i.e. the podman-next COPR.

Note that this does not preclude testing a podman PR against a e.g. a
crun PR: This can be explicitly requested [1]. But most PRs don't change
the API and thus should default to isolation.

[1] https://packit.dev/posts/testing-farm-triggering

[NO NEW TESTS NEEDED]

Signed-off-by: Martin Pitt <mpitt@redhat.com>
2023-08-16 19:12:59 +00:00
OpenShift Merge Robot
8183ba8b25
Merge pull request #19636 from edsantiago/skip_flaky_gating_tests
[v4.6] Skip tests that fail in gating
2023-08-16 07:01:01 -02:30
Ed Santiago
180869e4d3 Skip tests that fail in gating
SELinux tests are failing in f37, f38, Rawhide. (Did I miss any?)
Assume that the new container-selinux will never be available on
any of those, so let's just skip those tests. #19376

Pasta ICMP test fails pretty consistently in Gating, and is even
flaking in Cirrus, so let's skip that too. #19612

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-08-15 11:29:29 -06:00
OpenShift Merge Robot
9d077406c7
Merge pull request #19631 from matejvasek/backport-pull-param-fix
[v4.6] fix: pull parma parsing for the /build compat ep
2023-08-15 11:00:16 -02:30
Matej Vasek
888a52ded8 fix: pull parma parsing for the /build compat ep
The standard Docker client passes "1" for pull query parameter.
This means our compat endpoint has to work with this.
The endpoint was recently modified to accept pull-policy however this is
not how Docker actually work. Docker actually treats `pull` as boolean.

For sake of compatibility I decide to preserve pull-policy parsing too.
We can consider this podman's extension. I should not affect standard
clients.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-08-15 14:56:56 +02:00
OpenShift Merge Robot
35e7b30399
Merge pull request #19597 from ashley-cui/46
[CI:DOCS] [4.6] Update Release Notes
2023-08-14 03:18:26 -04:00
Ashley Cui
547853d279 [CI:DOCS] Update Release Notes
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-11 11:15:33 -04:00
OpenShift Merge Robot
f289e5df6f
Merge pull request #19588 from ashley-cui/461
Bump to v4.6.1
2023-08-10 16:17:05 -04:00
Ashley Cui
21da8fb692 Bumpt to v4.6.2-dev
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-10 14:14:22 -04:00
Ashley Cui
f3069b3ff4
Bump to v4.6.1
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-10 14:13:43 -04:00
Ashley Cui
57bdc5ea89 Release notes for v4.6.1
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-10 14:11:22 -04:00
Ashley Cui
3c7c8560de Vendor buildah v1.31.2
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-08-10 13:58:29 -04:00
OpenShift Merge Robot
1425dce370
Merge pull request #19584 from vrothberg/4.6-vendor-common
[4.6] vendor c/common v0.55.3
2023-08-10 09:29:32 -04:00
Valentin Rothberg
50501a945f [4.6] vendor c/common v0.55.3
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-08-10 09:51:46 +02:00
OpenShift Merge Robot
7de8fda2c6
Merge pull request #19553 from TomSweeneyRedHat/dev/tsweeney/nochunked
[v4.6] Remove zstd:chunked reference
2023-08-09 07:53:08 -04:00
TomSweeneyRedHat
2d02865cb7 [v4.6] Remove zstd:chunked reference
Remove the references of the zstd:chunked encryption algorithm as
this will not be supported in RHEL 8.9/9.3 in Podman v4.6.1.  Support
is expected in Podman v4.7 and later.

[NO NEW TESTS NEEDED]
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2023-08-08 15:09:39 -04:00
OpenShift Merge Robot
3ecd29fab4
Merge pull request #19536 from lsm5/v4.6-cve-2023-3978
[v4.6] bump golang.org/x/net to v0.13.0
2023-08-08 04:55:10 -04:00
Lokesh Mandvekar
ef9747c159
[v4.6] bump golang.org/x/net to v0.13.0
Resolves: CVE-2023-3978
Ref: https://pkg.go.dev/vuln/GO-2023-1988

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-08-07 09:00:57 -04:00
OpenShift Merge Robot
2215847e66
Merge pull request #19473 from edsantiago/openqa_v46
[v4.6] System tests: add test tags
2023-08-01 22:54:13 +02:00
OpenShift Merge Robot
a73b87fb87
Merge pull request #19476 from lsm5/cherry-pick-19333-to-v4.6
[v4.6] [CI:BUILD] RPM: separate out gvproxy for copr and fedora >= 38
2023-08-01 21:28:49 +02:00
Lokesh Mandvekar
f05f007178
do not redefine gobuild for eln
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
(cherry picked from commit e1114f03ce)
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-08-01 14:17:49 -04:00
Lokesh Mandvekar
45fd917fa8
[CI:BUILD] RPM: define gobuild macro for rhel/centos stream
The current gobuild macro doesn't account for build tags on both c9s and
c8s. This is currently causing copr build failures for c9s.

Ref: https://copr.fedorainfracloud.org/coprs/rhcontainerbot/podman-next/build/6220412/

This commit will define gobuild for all those envs until gobuild is
fixed by default.

Refs:
c9s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227328
c8s bz: https://bugzilla.redhat.com/show_bug.cgi?id=2227331

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
(cherry picked from commit e973d15c35)
Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-08-01 14:17:42 -04:00
Lokesh Mandvekar
8ee1f1197d
[v4.6] [CI:BUILD] RPM: separate out gvproxy for copr and fedora >= 38
gvproxy has now been approved as a standalone package on Fedora and will
be included separately for fedora 38 and higher.

[NO NEW TESTS NEEDED]

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-08-01 14:13:44 -04:00
Ed Santiago
5831bd68bf System tests: add test tags
[
  Clean cherry-pick of #19302. This is a low-risk change
  with potentially very high ROI: the opportunity to catch
  interaction problems with updates in other system components.
]

BATS 1.8.0 introduces tags: metadata that can be applied to
a single test or one entire file, then used for filtering
in a test run.

Issue #19299 introduces the possibility of using OpenQA
for podman reverse dependency testing: continuous CI on
all packages that can affect podman, so we don't go two
months with no bodhi builds then get caught by surprise
when systemd or kernel or crun change in ways that break us.

This PR introduces one bats tag, "distro-integration".
The intention is for OpenQA (or other) tests to install
the podman-tests package and run:

    bats --filter-tags distro-integration /usr/share/podman/test/system

Goal is to keep the test list short and sweet: we do not
need to test command-line option parsing. We *DO* need to
test interactions with systemd, kernel, nethack, and other
critical components.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-08-01 10:56:17 -06:00
OpenShift Merge Robot
2b6baf9506
Merge pull request #19466 from openshift-cherrypick-robot/cherry-pick-19413-to-v4.6
[v4.6] API: kill: return 409 on invalid state
2023-08-01 12:03:30 +02:00
OpenShift Merge Robot
58d6ba7fbb
Merge pull request #19452 from rhatdan/v4.6
[v4.6] If quadlets have same name, only use first
2023-08-01 12:00:57 +02:00
Valentin Rothberg
954177e7ee API: kill: return 409 on invalid state
If the container isn't running, make sure to return 409 as specified in
the Docker API [1] and the Podman reference.

[1] https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerKill

Fixes: #19368
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-08-01 07:55:48 +00:00
Daniel J Walsh
77b57996aa
Merge pull request #19458 from openshift-cherrypick-robot/cherry-pick-19451-to-v4.6
[v4.6] [CI:DOCS] Mention TimeoutStartSec in quadlet man page
2023-07-31 19:42:29 -04:00
Daniel J Walsh
e4e983e7af Mention TimeoutStartSec in quadlet man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-31 18:19:02 +00:00
Daniel J Walsh
d68ee576ef
If quadlets have same name, only use first
If a user puts a quadlet file in his homedirectory with
the same name as one in /etc/containers/systemd/user or
/etc/containers/systemd/user/$UID, then only use the one in
homedir and ignore the others.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-31 11:01:23 -04:00
OpenShift Merge Robot
2718901816
Merge pull request #19300 from ashley-cui/460final
Bump to v4.6.0
2023-07-21 00:02:51 +02:00
Ashley Cui
94431182ba Bump to v4.6.1-dev
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-07-20 16:13:44 -04:00
Ashley Cui
38e6fab966
Bump to v4.6.0
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-07-20 16:13:05 -04:00
Ashley Cui
8aec5997e1 Update release notes for v4.6.0
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-07-20 16:06:44 -04:00
Matt Heon
09b1da382f Ensure that we appropriately warn that TCP is insecure
`podman system service` + TCP is not a configuration we should be
recommending. There was already language about this in the
manpages, but it was not sufficient in explaining how bad of an
idea this is. Expand the manpage warnings, add a dedicated
heading so people notice, and add a warning every time the
service starts with a TCP URL that directs people to the manpage
to see that explanation.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-07-20 16:06:44 -04:00
Paul Holzinger
0115a4800b 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-20 15:46:28 -04:00
Paul Holzinger
598ebe8a1b 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-20 15:46:28 -04:00
Paul Holzinger
574b78291c 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-20 15:46:28 -04:00