22568 Commits

Author SHA1 Message Date
88b80c1df6 test/e2e: podman unshare image mount fix tmpdir leak
Because the test left the image mounted the cleanup failed to remove the
tmpdir as it contained an active mount point. Thus ensure we unmount the
image again to prevent this leak.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-29 14:16:37 +02:00
0faded53b8 test/e2e: do not leak /tmp/private_file
This should use the proper per test tempdir which works just as well for
the purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-29 14:16:37 +02:00
88a625d319 test/e2e: "persistentVolumeClaim with source" do not leak file
Using /tmp means this file will be leaked and no deleted, switch to
using the per test tempdir which is removed after the test.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-29 14:16:36 +02:00
9ac6d9de45 Merge pull request #22207 from edsantiago/e2e-var-tmp
e2e tests: use /var/tmp, not $TMPDIR, as workdirs
2024-04-26 22:21:14 +00:00
eaf60c7fe7 e2e tests: use /var/tmp, not $TMPDIR, as workdirs
TMPDIR is typically /tmp which is typically(*) a tmpfs.

This PR ignores $TMPDIR when $CI is defined, forcing all
e2e tests to set up one central working directory in /var/tmp
instead.

Also, lots of cleanup.

 (*) For many years, up to and still including the time of
     this PR, /tmp on Fedora CI VMs is actually NOT tmpfs,
     it is just / (root). This is nonstandard and undesirable.
     Efforts are underway to remove this special case.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-26 14:29:56 -06:00
e5cfbbb09e Merge pull request #22520 from joshua-stone/specfix-summary-typo-fix
[skip-ci] Remove unncessary lines at the end of specfile summary
2024-04-26 18:43:50 +00:00
60b5488308 Update dependency pytest to v8.1.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-26 18:14:28 +00:00
02cfd71fe8 Merge pull request #22507 from ashley-cui/cache
Clean machine pull cache
2024-04-26 18:13:34 +00:00
cd6ff71cc3 Remove unncessary lines at the end of specfile summary
Signed-off-by: joshua-stone <joshua.gage.stone@gmail.com>
2024-04-26 14:09:37 -04:00
e412eff33f Clean machine pull cache
Cache cleanups only happen if there is a cache miss, and we need to pull a new image

For quay.io/podman/machine-os, we remove all old images from the cache dir. This means we will delete any file that exists in the cache dir; this should be safe to do since the machine pull code should be the only thing touching this cache dir. OCI machine images will always have a different manifest, and won’t be updated with the same manifest, so if the version moves on, there isn’t a reason to keep the old version in the cache, it really doesn’t change.

For Fedora (WSL), we use the cache, so we go through the cache dir and remove any old cached images, on a cache miss. We also switch to using ~/.local/share/containers/podman/machine/wsl/cache as the cache dir rather than ~/.local/share/containers/podman/machine/wsl. Both these behaviors existed in v4.9, but are now added back into 5.x.

For generic files pulled from a URL or a non-default OCI image, we shouldn’t actually cache, so we delete the pulled file immediately after creating a machine image. This restores the behavior from v4.9.

For generic files from a local path, the original file will never be cleaned up

Unsure how to test, so:
[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2024-04-26 12:31:42 -04:00
80534fbe59 Merge pull request #22491 from baude/libkrun
Add krun support to podman machine
2024-04-26 15:06:33 +00:00
c94a720bb3 Merge pull request #22494 from baude/validateimage
Use custom image for make validatepr
2024-04-26 15:03:49 +00:00
d2c1de5993 Add krun support to podman machine
This PR adds libkrun support to podman machine.  This is an experimental feature and should not be marketed yet.  Before we unmark the experimental status on this function, we will need to have full CI support and a full podman point release has pased.

This work relies on the fact that vfkit and libkrun share a reasonably (if not perfectly) same API.  The --log-level debug option will not show a GUI screen for boots as krun is not capable of this.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-04-26 08:58:38 -05:00
0b9bc253a2 Merge pull request #22516 from Luap99/e2e-fixes
test/e2e: fixes to make test pass locally
2024-04-26 13:46:46 +00:00
ca23774b5b Use custom image for make validatepr
The fedora image reviewers wanted to use for make validatepr is not
being being built as a multiarch image.  Use quay.io/libpod/validatepr
instead.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2024-04-26 07:53:16 -05:00
9a0ed6929a test/e2e: force systemd cgroup manager
It is not clear why rootless was forced to the cgroupfs manager when
systemd is the default. In any case it causes local test failures as
described in the issue[1]. Using systemd manager makes them pass as
expected, I don't know enough aout cgroups to know the difference and
why certain tests have bad asumptions but this fixes it.

[1] https://github.com/containers/podman/issues/22474

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:37:31 +02:00
d1bfdc7900 e2e and bindings tests: fix $PATH setup
Both tests need the podman-registry script in $PATH, this never worked
locally as only the cirrus specific CI setup scripts configured this.

To make it work correctly locally add the hack dir to $PATH for these
Makefile targets.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:37:27 +02:00
5040c6e390 Makefile: remove useless HACK variable in e2e test
This doesn't do anything and I was unable to find anything in the git
history when or why it was added. The HACK var is just adding another
directory to the ginkgo argument list. As the only arg used was the
"./hack" dir which does not contain any go files it does nothing
besides confusing me about its purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:36:20 +02:00
537c21a49a test/e2e: fix volumes and suid/dev/exec options
When the source dir is already mounted noexec, nodev or nosuid then a
rootless user cannot mount the dir into the container without these
options for obvious reasons.

So in order to run the test we must ensure the dir is mounted with these
options first, if they are simply skip as the test will fail otherwise.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:36:20 +02:00
31034a1b6f test/e2e: volumes and suid/dev/exec options works remote
--volume works fine with podman-remote you just need to know that the
path is server side.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:36:20 +02:00
cc6e999f2a test/e2e: fix limits test
When you run locally with a higher oom_score_adj then the one used in
the test podman will print a warning and not set the oom lower then the
current value. Thus use 999 as value which should only cause problems
for users with oom_score_adj value of 1000 (max value) which seems
unlikely.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-26 14:36:19 +02:00
ebc48503a8 Merge pull request #22512 from containers/renovate/github.com-rootless-containers-rootlesskit-v2-2.x
Update module github.com/rootless-containers/rootlesskit/v2 to v2.1.0
2024-04-26 12:24:15 +00:00
3927a52ece Merge pull request #22509 from sanmai-NL/Clarify-network-options-docs
Correct network option name `ip` -> `ip6`
2024-04-26 12:21:30 +00:00
195d10011c Merge pull request #22481 from findnature/main
chore: fix function names in comment
2024-04-26 12:18:46 +00:00
abbfdb3622 Merge branch 'containers:main' into main 2024-04-26 10:07:05 +08:00
c2d7b5415f Update module github.com/rootless-containers/rootlesskit/v2 to v2.1.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-26 02:06:10 +00:00
3c1c6a44ef Correct option name ip -> ip6
Also, properly capitalize.

Signed-off-by: Sander Maijers <3374183+sanmai-NL@users.noreply.github.com>
2024-04-25 22:17:06 +02:00
15cc8862c1 Merge pull request #22410 from mheon/automount_images_k8s
Add the ability to automount images as volumes via play
2024-04-25 19:26:47 +00:00
30e2c923d6 Add the ability to automount images as volumes via play
Effectively, this is an ability to take an image already pulled
to the system, and automatically mount it into one or more
containers defined in Kubernetes YAML accepted by `podman play`.

Requirements:
- The image must already exist in storage.
- The image must have at least 1 volume directive.
- The path given by the volume directive will be mounted from the
  image into the container. For example, an image with a volume
  at `/test/test_dir` will have `/test/test_dir` in the image
  mounted to `/test/test_dir` in the container.
- Multiple images can be specified. If multiple images have a
  volume at a specific path, the last image specified trumps.
- The images are always mounted read-only.
- Images to mount are defined in the annotation
  "io.podman.annotations.kube.image.automount/$ctrname" as a
  semicolon-separated list. They are mounted into a single
  container in the pod, not the whole pod.

As we're using a nonstandard annotation, this is Podman only, any
Kubernetes install will just ignore this.

Underneath, this compiles down to an image volume
(`podman run --mount type=image,...`) with subpaths to specify
what bits we want to mount into the container.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-25 14:12:27 -04:00
693ae0ebc6 Add support for image volume subpaths
Image volumes (the `--mount type=image,...` kind, not the
`podman volume create --driver image ...` kind - it's strange
that we have two) are needed for our automount scheme, but the
request is that we mount only specific subpaths from the image
into the container. To do that, we need image volume subpath
support. Not that difficult code-wise, mostly just plumbing.

Also, add support to the CLI; not strictly necessary, but it
doesn't hurt anything and will make testing easier.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-25 14:12:27 -04:00
273020160c Merge pull request #22504 from mheon/bump_buildah_fix_ci
Bump buildah to fix CI
2024-04-25 18:06:20 +00:00
0ccee4e51f Merge pull request #22489 from edsantiago/exitwitherror-yetmorelowhangingfruit
ExitWithError() - yet more low-hanging fruit
2024-04-25 18:03:36 +00:00
5f57571d65 Bump Buildah to latest main
Includes fixes from Ed's treadmill script.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-25 12:17:43 -04:00
e8a9c58125 Update Makefile to Go 1.22 for in-container
This unbreaks make vendor-in-container now that we have the
`toolchain` line in go.mod.

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-04-25 12:12:48 -04:00
1526ebf095 Merge pull request #22461 from containers/renovate/github.com-docker-docker-26.x
fix(deps): update module github.com/docker/docker to v26.1.0+incompatible
2024-04-24 15:42:10 +00:00
e4c9910aec ExitWithError() - yet more low-hanging fruit
Followup to [1]#22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

Just trying to shrink down #22346 to a manageable, reviewable size.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-24 09:04:50 -06:00
1a23451067 Merge pull request #22486 from edsantiago/exitwitherror-morelowhangingfruit
ExitWithError() - more low-hanging fruit
2024-04-24 14:58:22 +00:00
a7c61c31a3 Merge pull request #22465 from Luap99/go1.21
Update to go 1.21
2024-04-24 14:30:59 +00:00
3b212957d5 Merge pull request #22485 from edsantiago/exitwitherror-lowhangingfruit
ExitWithError() - low-hanging fruit
2024-04-24 13:27:27 +00:00
80c3a22440 ExitWithError() - more low-hanging fruit
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

More low-hanging fruit: small reviewable chunks

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-24 07:11:40 -06:00
4da5c5d3aa ExitWithError() - low-hanging fruit
Followup to #22270: wherever possible/practical, extend command
error checks to include explicit exit status codes and error strings.

Because #22346 is stalled, these are some trivial easy-to-review
changes that get us closer to the goal.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-04-24 05:44:40 -06:00
c681df35c0 chore: fix function names in comment
Signed-off-by: findnature <cricis@aliyun.com>
2024-04-24 12:07:38 +08:00
f82c7cefef Merge pull request #22468 from grisu48/contributing
[CI:DOCS] Remove redundant Prerequisite before build section
2024-04-23 21:34:37 +00:00
5e1c3f58dc Merge pull request #22458 from ashley-cui/artifacts
[CI:DOCS] Fix artifact action
2024-04-23 20:45:08 +00:00
3f78c39c50 Remove redundant Prerequisite before build section
The contents of the "Prerequisite before buil"d section are given already
in a link in its "Prepare your environment" parent section and therefore
redundant. Let's remove it.

Signed-off-by: phoenix <felix.niederwanger@suse.com>
2024-04-23 14:48:46 +02:00
35c2c82df2 Merge pull request #22464 from grisu48/opensuse
[CI:DOCS] Add installation instructions for openSUSE
2024-04-23 12:35:36 +00:00
fa1fd1646e Remove PKG_CONFIG_PATH
Remove the export PKG_CONFIG_PATH which appears not necessary anymore.

Signed-off-by: phoenix <felix.niederwanger@suse.com>
2024-04-23 11:59:09 +02:00
3b28cdfb20 Add installation instructions for openSUSE
Adds the installation instructions for openSUSE, similar to the present
ones for Fedora and Debian/Ubuntu.

Tested on openSUSE Tumbleweed and Leap 15.6.

Signed-off-by: phoenix <felix.niederwanger@suse.com>
2024-04-23 11:57:57 +02:00
83dbbc3a51 Replace golang.org/x/exp/slices with slices from std
Use "slices" from the standard library, this package was added in go
1.21 so we can use it now.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-23 11:16:40 +02:00
c04d03ef8c Update to go 1.21
So that we can continue updating our dependencies.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-04-23 11:07:28 +02:00