21024 Commits

Author SHA1 Message Date
5af152ec29 Merge pull request #20874 from mheon/eval_symlinks_on_db_paths
Handle symlinks when checking DB vs runtime configs
2023-12-03 11:50:03 +00:00
f384bdf66b Handle symlinks when checking DB vs runtime configs
When Podman starts, it checks a number of critical runtime paths
against stored values in the database to make sure that existing
containers are not broken by a configuration change. We recently
made some changes to this logic to make our handling of the some
options more sane (StaticDir in particular was set based on other
passed options in a way that was not particularly sane) which has
made the logic more sensitive to paths with symlinks. As a simple
fix, handle symlinks properly in our DB vs runtime comparisons.

The BoltDB bits are uglier because very, very old Podman versions
sometimes did not stuff a proper value in the database and
instead used the empty string. SQLite is new enough that we don't
have to worry about such things.

Fixes #20872

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-12-02 15:48:47 -05:00
bc124dd13f Merge pull request #20819 from cgiradkar/20752_farm_flag_move
Move the --farm flag to farm build command
2023-12-01 21:12:38 +00:00
c47962802a Merge pull request #20657 from nalind/commit-config
RHEL-14922: accept a config blob alongside the "changes" slice when committing
2023-12-01 21:09:23 +00:00
5364fbd7e4 Merge pull request #20869 from dfr/freebsd-hostname
libpod: Detect whether we have a private UTS namespace on FreeBSD
2023-12-01 17:21:09 +00:00
3b03e85471 Merge pull request #20789 from umohnani8/healthcheck
Don't update health check status during initialDelaySeconds
2023-12-01 13:12:50 +00:00
45e53ed7b0 libpod: Detect whether we have a private UTS namespace on FreeBSD
Right now, we always use a private UTS namespace on FreeBSD. This should
be made optional but implementing that cleanly needs a FreeBSD extension
to the OCI runtime config. The process for that is starting
(https://github.com/opencontainers/tob/pull/133) but in the meantime,
assume that the UTS namespace is private on FreeBSD.

This moves the Linux-specific namespace logic to
container_internal_linux.go and adds a FreeBSD stub.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-12-01 12:37:39 +00:00
d3d9293b2a Merge pull request #20831 from Luap99/remote-exec-rm
fix podman-remote exec regression with v4.8
2023-12-01 09:59:21 +00:00
500da5ecc9 Merge pull request #20848 from edsantiago/safer_defer
deferred test failures: handle a corner case
2023-12-01 09:56:52 +00:00
b05755b0a8 Merge pull request #20742 from containers/renovate/common-image-and-storage-deps
fix(deps): update common, image, and storage deps
2023-12-01 00:03:50 +00:00
9b2529e0d7 Merge pull request #20833 from sanmai-NL/patch-1
Set `BUILDAH_ISOLATION=chroot` within Podman Containerfile
2023-11-30 22:26:41 +00:00
c1eea91a01 fix(deps): update common, image, and storage deps
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-11-30 14:48:27 +00:00
31df9c237e Move the --farm flag to farm build command
The option `farm` which is used to specify the farm to be used, is moved to farm build command from farm command.

closes #20752

Signed-off-by: Chetan Giradkar <cgiradka@redhat.com>
2023-11-30 14:27:06 +00:00
fa0aa91132 @@option volume.image: be specific that -v only affects RUN
Be specific that the `-v` flag only affects RUN instructions.  The
previous wording left it ambiguous, and people might have concluded that
it applied to ADD and COPY as well.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-30 09:05:33 -05:00
426db6fcc1 Accept a config blob alongside the "changes" slice when committing
When committing containers to create new images, accept a container
config blob being passed in the body of the API request by adding a
Config field to our API structures.  Populate it from the body of
requests that we receive, and use its contents as the body of requests
that we make.

Make the libpod commit endpoint split changes values at newlines, just
like the compat endpoint does.

Pass both the config blob and the "changes" slice to buildah's Commit()
API, so that it can handle cases where they overlap or conflict.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-30 09:00:52 -05:00
e197cf57da container create: use ParseUserNamespace to parse a user namespace setting
Use ParseUserNamespace instead of ParseNamespace to parse a passed-in
user namespace setting.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-30 09:00:52 -05:00
f2f7d60741 Merge pull request #20841 from ashley-cui/wsldeadlock
Fix locking error in WSL machine rm -f
2023-11-30 14:00:35 +00:00
f95dd21d5d deferred test failures: handle a corner case
Followup to #20797 (defer assertion failures). The bail-now()
helper was being defined only in setup() ... and some tests,
particularly 001-basic.bats, define their own minimalist setup().

Symptom was "bail-now: command not found", which still caused
test to fail (so no failures were hidden) but led to concern
and wasted time when analyzing failures.

Solution: add one more definition of bail-now(), in outer scope.

There is still one pathological case I'm not addressing: a
bats file that defines its own teardown() which does not invoke
basic_teardown(), then has a test that runs defer-assertion-failures
without a followup immediate-assertion-failures. This would lead
to failures that are never seen. Since teardown() without basic_teardown()
is invalid, I choose not to worry about this case.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-30 06:33:46 -07:00
6b9221d852 Merge pull request #20837 from dfr/freebsd-vnet
libpod: Allow using just one jail per container on FreeBSD
2023-11-30 08:38:20 +00:00
572a7692e3 Merge pull request #20828 from alexlarsson/quadlet-snippets
quadlet: Support systemd style dropin files
2023-11-29 23:24:33 +00:00
385f8526b3 Merge pull request #20834 from edsantiago/gating_fixes
Gating test fixes
2023-11-29 23:10:50 +00:00
ea549c9163 Merge pull request #20836 from ashley-cui/vendor
Vendor c/common
2023-11-29 23:02:34 +00:00
42ea211211 Fix locking error in WSL machine rm -f
Fixed a bug where `podman machine rm -f` would cause a deadlock when
running with WSL.

The deadlock is caused by the Remove() function calling the Stop()
function after Remove() locks the VM. Stop() also has a lock call, which
fails and deadlocks because Remove() already claimed lock. Fix this by
moving the stop call before the lock

[NO NEW TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-11-29 16:28:59 -05:00
5da1790a28 Merge pull request #20838 from Luap99/sqlite-timeout
sqlite: set busy timeout to 100s
2023-11-29 19:21:12 +00:00
5b3d82f9bc sqlite: set busy timeout to 100s
Only one process can write to the sqlite db at the same time, if another
process tries to use it at that time it fails and a database is locked
error is returned. If this happens sqlite should keep retrying until it
can write. To do that we can just set the _busy_timeout option. A 100s
timeout should be enough even on slower systems but not to much in case
there is a deadlock so it still returns in a reasonable time.

[NO NEW TESTS NEEDED] I think we strongly need to consider some form of
parallel stress testing to catch bugs like this.

Fixes #20809

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-11-29 18:07:29 +01:00
d4ac2f3dd5 libpod: Allow using just one jail per container on FreeBSD
In FreeBSD-14.0, it is possible to configure a jail's network settings
from outside the jail using ifconfig and route's new '-j' option. This
removes the need for a separate jail to own the container's vnet.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2023-11-29 16:18:34 +00:00
55373dcce0 Vendor c/common
Vendor c/common@main

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-11-29 10:17:54 -05:00
3e70415089 Gating test fixes
Two newly-added tests, fail in gating:
 - system connection: difference in how sockets are set up
   between CI and gating
 - ulimit: gating seems to run with ulimit -c -H 0. Check, and
   skip if ulimit is less than what we need

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-11-29 07:51:43 -07:00
86296ff8da pkg/bindings: add new APIVersionError error type
When a new API call is added to the bindings we should guard it based on
the version and throw a useful error. Right now an old server that does
not implement a given endpoint would throw a "NOT FOUND" error which is
not good for callers.

Instead implement a custom error type to give a usefule error instead.
This allows bindings users to call errors.As() to know if they call and
to old version.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-11-29 15:31:42 +01:00
a5d11f4041 Set BUILDAH_ISOLATION=chroot within Podman containers
See: https://developers.redhat.com/blog/2019/08/14/best-practices-for-running-buildah-in-a-container

See: 06c41b614d/docs/source/markdown/options/isolation.md

Signed-off-by: Sander Maijers <3374183+sanmai-NL@users.noreply.github.com>
2023-11-29 14:45:21 +01:00
f35d1c1c25 Don't update health check status during initialDelaySeconds
When InitialDelaySeconds in the kube yaml is set for a helthcheck,
don't update the healthcheck status till those initial delay seconds are over.
We were waiting to update for a failing healtcheck, but when the healthcheck
was successful during the initial delay time, the status was being updated as healthy
immediately.
This is misleading to the users wondering why their healthcheck takes
much longer to fail for a failing case while it is quick to succeed for
a healthy case. It also doesn't match what the k8s InitialDelaySeconds
does. This change is only for kube play, podman healthcheck run is
unaffected.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-11-29 08:37:39 -05:00
8ee2622028 quadlet: Support systemd style dropin files
For a source file like `foo.container`, look for drop in named
`foo.container.d/*.conf` and merged them into the main file.  The
dropins are applied in alphabetical order, and files in earlier
diretories override later files with same name.

This is similar to how systemd dropins work, see:
https://www.freedesktop.org/software/systemd/man/latest/systemd.unit.html

Also adds some tests for these

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2023-11-29 13:46:52 +01:00
93bcd2a25d fix podman-remote exec regression with v4.8
Commit f48a706abc added a new API endpoint to remove exec session
correctly. And the bindings try to call that endpoint for exec every
time. Now since client and server must not be the same version this
causes a problem if a new 4.8 client calls an older 4.7 server as it has
no idea about such endpoint and throws an ugly error. This is a common
scenario for podman machine setups.

The client does know the server version so it should make sure to not
call such endpoint if the server is older than 4.8.

I added a exec test to the machine tests as this can be reproduced with
podman machine as at the moment at least the VM image does not contain
podman 4.8. And it should at least make sure podman exec keeps working
for podman machine without regressions.

Fixes #20821

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-11-29 13:22:46 +01:00
06c41b614d Merge pull request #20595 from containers/renovate/github.com-gorilla-schema-1.x
fix(deps): update module github.com/gorilla/schema to v1.2.1
2023-11-29 12:06:38 +00:00
e0a524f630 Merge pull request #20823 from nalind/close-that-readcloser
utils: close a couple of ReadClosers
2023-11-29 02:18:06 +00:00
d6fefe0ba7 Merge pull request #20822 from mtrmac/chown-cleanup
Fix transferring data using tar
2023-11-29 02:15:17 +00:00
6d9d8f06ce Merge pull request #20517 from rhatdan/mask
Get masked paths and readonly masked patchs from containers/common @rhatdan
2023-11-29 02:12:37 +00:00
828ef9e174 Merge pull request #20817 from eriksjolund/fix-markdown-bugs
[CI:DOCS] Fix markdown bugs
2023-11-29 02:09:43 +00:00
e14d095243 Merge pull request #20794 from eriksjolund/document-sometimes-slow-native-overlayfs
[CI:DOCS] performance: document sometimes slow native overlayfs
2023-11-29 01:22:57 +00:00
5ab4513b26 Merge pull request #20798 from n1hility/fix-user-mode-disable
Fix wsl.conf generation when user-mode-networking is disabled
2023-11-29 01:20:12 +00:00
21951e2376 Merge pull request #20799 from edsantiago/symlink-mounts
[systests] podman mount no-dereference: complete rewrite
2023-11-29 01:14:48 +00:00
cf1ad300bb utils: close a couple of ReadClosers
utils.Tar() and utils.TarWithChroot() both return ReadClosers, but when
we called them from utils.TarToFilesystem() and utils.TarChrootToFilesystem()
respectively, they were not being closed.

[NO NEW TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-11-28 15:48:00 -05:00
4314b1c344 Fix transferring data using tar
Instead of relying on the remote server to create tar files
with the right account IDs (which the remote server doesn't
even know, when the client and server run under different accounts),
have the remote client ignore the account IDs when unpacking.

Then just hard-code 0 in the remote server, so that the remote
server's account identity does not leak in the tar file contents.

Compare https://github.com/containers/image/issues/1627 .

[NO NEW TESTS NEEDED] : https://github.com/containers/podman/pull/18563
suggests that existing tests already cover these code paths / properties.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-11-28 20:44:17 +01:00
443e779a1f Merge pull request #20804 from BlackHole1/improve-vmtype
refactor(machine): improve machine marker value
2023-11-28 19:12:51 +00:00
7b4d6a295e [CI:DOCS] Fix markdown bugs
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-11-28 17:28:08 +01:00
83c08a2f5c Merge pull request #20609 from cgiradkar/19124_remove_event_fix
Set correct exitcode in remove events
2023-11-28 16:21:17 +00:00
2645f91bfe Merge pull request #20813 from Luap99/sqlite-removepodcontainers
sqlite: fix missing Commit() in RemovePodContainers()
2023-11-28 16:07:18 +00:00
9627d3043d Merge pull request #20810 from Luap99/sqlite-validate
sqlite: fix issue in ValidateDBConfig()
2023-11-28 16:04:42 +00:00
545daed1e4 Merge pull request #20762 from ygalblum/quadlet-pod
Quadlet - Add support for .pod units
2023-11-28 14:44:00 +00:00
9a120321c7 Merge pull request #20807 from giuseppe/fix-mount-tmpfs-mode
docs: drop default for tmpfs-mode
2023-11-28 14:17:25 +00:00