6923 Commits

Author SHA1 Message Date
4f7395f93a Add --hosts-file flag to container and pod commands
* Add --hosts-file flag to container create, container run and pod create
* Add HostsFile field to pod inspect and container inspect results
* Test BaseHostsFile config in containers.conf

Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2024-11-24 22:00:34 -05:00
dc564257a2 Add nohosts option to /build and /libpod/build
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2024-11-24 22:00:31 -05:00
13affe96d6 Quadlet - Use = sign when setting the pull arg for build
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-11-22 15:06:50 -05:00
d85ac938e6 Merge pull request #24442 from Honny1/change-healthcheck-config-via-podman-update
Configure HealthCheck with `podman update`
2024-11-22 15:57:30 +00:00
60ddddcf44 Merge pull request #24635 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.22.0
2024-11-21 10:04:20 +00:00
34d63459ba fix(deps): update module github.com/onsi/ginkgo/v2 to v2.22.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-21 04:19:54 +00:00
3096681ce3 chore(deps): update dependency setuptools to ~=75.6.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-20 20:27:53 +00:00
a1249425bd Configure HealthCheck with podman update
New flags in a `podman update` can change the configuration of HealthCheck when the container is started, without having to restart or recreate the container.

This can help determine why a given container suddenly started failing HealthCheck without interfering with the services it provides. For example, reconfigure HealthCheck to keep logs longer than the usual last X results, store logs to other destinations, etc.

Fixes: https://issues.redhat.com/browse/RHEL-60561

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2024-11-19 19:44:14 +01:00
97ed067d1a CI: --image-volume test: robustify
Test is failing on 1mt because of differences between 'stat'
command output and /proc/mounts. Solution: compare stat %t
(hex filesystem type), not %T (human-readable). This should
match no matter what kernel version or version of stat on
host/container.

Fixes: #24611

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-19 10:03:55 -07:00
61b57b7d7d Overlay mounts supersede image volumes & volumes-from
This matches the behavior of other volume and mount types. Image
volumes and volumes/mounts from the `--volumes-from` flag should
be overridden by actual user-specified named volumes and mounts,
but this was not true for overlay mounts. Fortunately, our
duplicate-mount detection logic still works, so we got a good
error message at least.

The fix is simple - extend our supersede logic, which currently
only works with named volumes and mounts, to also work with
overlay mounts.

Fixes #24555

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-11-15 08:26:16 -05:00
fa5e3b6e94 Merge pull request #24535 from M1cha/network-driver-options
add support for driver-specific options during container creation
2024-11-14 09:29:44 +00:00
ecaf9bf515 Merge pull request #24525 from Luap99/lint
update golangci-lint to v1.62.0
2024-11-13 21:47:38 +00:00
315e7412e8 add support for driver-specific options during container creation
This way has a huge disadvantage: The user will not see an error when he
uses a non-existent option. Another disadvantage is, that if we add more
options within podman, they might collide with the names chosen by
plugins. Such issues might be hard to debug.
The advantage is that the usage is very nice:
--network bridge:opt1=val1,opt2=val2.

Alternatively, we could put this behind `opt=`, which is harder to use,
but would solve all issues above:
--network bridge:opt=opt1=val1,opt=opt2=val2

Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
2024-11-13 18:14:58 +01:00
6a6e890553 Merge pull request #24553 from containers/renovate/setuptools-75.x
chore(deps): update dependency setuptools to ~=75.5.0
2024-11-13 12:47:43 +00:00
590fcafc2b chore(deps): update dependency setuptools to ~=75.5.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-13 12:01:33 +00:00
1c77ee6fc5 CI: system tests: parallelize 010
Final cleanup. Has been working fine in #23257 for weeks.
Not much gain here, but every little bit helps.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-13 04:14:57 -07:00
8f2d5011f2 Merge pull request #24532 from mheon/subpath
Add subpath support to volumes in `--mount` option
2024-11-12 21:46:58 +00:00
f41eab21de Merge pull request #24540 from Luap99/vendor
vendor containers projects to tagged versions
2024-11-12 15:00:03 +00:00
8a192c8403 Add subpath support to volumes in --mount option
All the backend work was done a while back for image volumes, so
this is effectively just plumbing the option in for volumes in
the parser logic. We do need to change the return type of the
volume parser as it only worked on spec.Mount before (which does
not have subpath support, so we'd have to pass it as an option
and parse it again) but that is cleaner than the alternative.

Fixes #20661

Signed-off-by: Matt Heon <mheon@redhat.com>
2024-11-12 09:13:16 -05:00
2bcbffa186 Merge pull request #24531 from containers/renovate/setuptools-75.x
chore(deps): update dependency setuptools to ~=75.4.0
2024-11-12 12:39:16 +00:00
0a1363d8eb test/e2e: remove FIPS test
First, creating a global file /etc/system-fips was never a good idea for
testing as it affects other running tests at the same time.
And as of a recent change to FIPS mounts[1] we no longer use the file so
the test breaks with c/common v0.61. Instead it uses the kernel file
/proc/sys/crypto/fips_enabled which requires the real fips mode to be
activated and that in turn requires a reboot. As such this is not
somthing that can be tested in upstream CI like that.

[1] https://github.com/containers/common/pull/2174

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-12 10:59:04 +01:00
ca7703643b chore(deps): update dependency setuptools to ~=75.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-11 19:10:38 +00:00
969417711d system tests: safer install_kube_template()
Previous version was badly broken: it relied on 'make'
rebuilding a file under cwd, which is a no-no; and, in
the case where we don't have a source directory, just
blindly hoped that there'd be a system-installed .service
file with the correct path to podman.

Solution:
  . if running in source directory, run sed directly into
    destination service file in $UNIT_DIR. This is ugly
    duplication of a line in Makefile.

  . if NOT running in a source directory, check $PODMAN:
    . if it's /usr/bin/podman, continue. Include a warning
      that will be shown only on test failure.
    . otherwise skip, because we don't know what we're testing

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-11 10:44:32 -07:00
33398ebc1e Buildah treadmill tweaks
* treadmill script: handle an obscure corner case
  wherein the script would bail because it thought
  there were no buildah-vendor changes.

* two new test skips

* update the diffs; line-number changes due to buildah
  PRs touching helpers.bash

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-11 07:04:39 -07:00
9eca92d625 update golangci-lint to v1.62.0
- fix issues found by recvcheck
- skip k8s files from recvcheck
- remove two removed linters gomnd and execinquery

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-11 14:21:17 +01:00
e1a6c53909 fix(deps): update module golang.org/x/tools to v0.27.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-11 10:19:25 +00:00
ee5b8de70d Merge pull request #24413 from giuseppe/add-test-zstd-chunked
tests: add basic zstd:chunked system test
2024-11-08 14:36:06 +00:00
a1c1ae62e7 Merge pull request #24340 from l0rd/ssh-knownhosts-test
New `system connection add` test
2024-11-08 13:24:46 +00:00
30a82cad7a test: add zstd:chunked system tests
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2024-11-08 12:39:07 +01:00
fbbfd07463 kube SIGINT system test: fix race in timeout handling
Up to now this test has been run using:

    PODMAN_TIMEOUT=2 run_podman kube play ...

...and this gives podman time to start the pod before getting
the signal.

When run in parallel, under heavy load, the above command seems
to time out before podman has gotten its act together. Weird
things happen, like weird exit status and (most crucially)
zombie containers.

Solution: wait for container to actually start before we kill it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-07 11:01:08 -07:00
b20960b860 New system connection add tests
These tests verify that podman successfully adds (or
fails to add) a connection to an SSH server based on
the entries in the `~/.ssh/known_hosts` file.

In particular `system connection add` should succeed if:
- there is no `know_hosts` file
- `known_hosts` has an entry that matches the first protocol/key returned
  by the SSH server
- `known_hosts` has an entry that matches the first protocol/key returned
  by the SSH server
- `known_hosts` has an entry for another SSH server, not for the target server

It should fail if the `known_host` file has an entry for
the target server that matches the protocol but not the key.

Depends on containers/common#2212
Fixes #23575

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2024-11-07 17:48:27 +01:00
cbf1d7fcae Avoid printing PR text to stdout in system test
Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2024-11-07 17:48:27 +01:00
22152a2f9c test/buildah-bud: build new inet helper
Added in https://github.com/containers/buildah/pull/5783

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-07 10:39:15 +01:00
fb3a0e93a8 test/system: add regression test for TZDIR local issue
Regression test for #23550. Setting the TZDIR env should make no
difference for the local timezone as this is not a real timezone name
that is resolved from that directory.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-07 10:39:15 +01:00
aac206e9c5 Merge pull request #24412 from Sativarsainath-26/network-events
Fix: To print create and remove network in podman events
2024-11-06 18:33:18 +00:00
6346a11b09 AdditionalSupport for SubPath volume mounts
Add support for inspecting Mounts which include SubPaths.

Handle SubPaths for kubernetes image volumes.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-11-06 10:10:26 -05:00
a358d83ce9 Merge pull request #24437 from lambinoo/feat-split-pod-container-start-24401
Add key to control if a container can get started by its pod
2024-11-05 15:04:16 +00:00
c23d9c6f23 Log network creation and removal events in Podman
This commit resolves an issue where network creation and removal events were not being logged in `podman events`. A new function has been introduced in the `events` package to ensure consistent logging of network lifecycle events. This update will allow users to track network operations more effectively through the event log, improving visibility and aiding in debugging network-related issues.

Fixes: #24032
Signed-off-by: Sainath Sativar <Sativar.sainath@gmail.com>
2024-11-05 11:58:47 +00:00
c8af2f2c1e Merge pull request #24334 from rhatdan/quadlet
Honor users requests in quadlet files
2024-11-05 09:45:11 +00:00
2597eeae70 Add key to control if a container can get started by its pod
By default today, the container is always started if its pod is also
started. This prevents to create custom with systemd where containers in
a pod could be started through their `[Install]` section.

We add a key `StartWithPod=`, enabled by default, that enables one to
disable that behavior.

This prevents the pod service from changing the state of the container
service.

Fixes #24401

Signed-off-by: Farya L. Maerten <me@ltow.me>
2024-11-05 08:39:23 +01:00
c6be5a6684 Honor users requests in quadlet files
Fixes: https://github.com/containers/podman/issues/24322

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-11-04 15:08:26 -05:00
df41725d61 Merge pull request #24461 from edsantiago/stop-trap-timeout
CI: systests: workaround for parallel podman-stop flake
2024-11-04 18:56:59 +00:00
0f25d9ee15 Merge pull request #24406 from Luap99/event-api-response
fix API issue about missing the status code in the events and logs endpoints
2024-11-04 18:54:14 +00:00
2c01264568 CI: systests: workaround for parallel podman-stop flake
Just bump up a timeout when running parallel, because of high load.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2024-11-04 10:45:14 -07:00
2279a77303 Merge pull request #24403 from Luap99/tools-vendor
go.mod vendor: ensure we never have the toolchain directive set
2024-11-04 17:15:12 +00:00
dbfc8cccda Quadlet - support image file based mount in container file
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2024-11-01 16:20:23 -04:00
e6d987882e API: container logs flush status code
API clients expect the status code quickly otherwise they can time out.
If we do not flush we may not write the header immediately and only when
futher logs are send.

Fixes #23712

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 18:54:13 +01:00
768ad8653a rework event code to improve API errors
One of the problems with the Events() API was that you had to call it in
a new goroutine. This meant the the error returned by it had to be read
back via a second channel. This cuased other bugs in the past but here
the biggest problem is that basic errors such as invalid since/until
options were not directly returned to the caller.
It meant in the API we were not able to write http code 200 quickly
because we always waited for the first event or error from the
channels. This in turn made some clients not happy as they assume the
server hangs on time out if no such events are generated.

To fix this we resturcture the entire event flow. First we spawn the
goroutine inside the eventer Read() function so not all the callers have
to. Then we can return the basic error quickly without the goroutine.
The caller then checks the error like any normal function and the API
can use this one to decide which status code to return.
Second we now return errors/event in one channel then the callers can
decide to ignore or log them which makes it a bit more clear.

Fixes c46884aa93 ("podman events: check for an error after we finish reading events")
Fixes #23712

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 18:54:13 +01:00
0acd192b59 Makefile: vendor target should always remove toolchain
We never want the toolchain as the default is to use the same as the go
version. So the only purpose of toolchain is to force a newer compiler
than necessary which we do not want as we are getting build by many
different distributions and block builds that would otherwise work fine
is just not helpful to anyone.

Also update the go.mod comments remind people that there should be no
toolchain. The make vendor target with the toolchain will now guarantee
this so the CI will fail otherwise.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 13:23:01 +01:00
f4ad93d5f6 test/tools/go.mod: remove toolchain
Like our main go.mod we never want to force a specific toolchain.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-11-01 13:23:01 +01:00