6967 Commits

Author SHA1 Message Date
4764b0e403 Add creation timestamp to podman artifacts
This commit implements automatic creation timestamp functionality for artifacts
as requested in GitHub issue #27081, allowing users to see when artifacts were created.

Changes made:
- Add org.opencontainers.image.created annotation with Unix nanoseconds timestamp during artifact creation
- Preserve original creation timestamp when using --append option
- Update artifact inspect and add man pages to document the new functionality
- Add comprehensive e2e and system BATS tests to verify creation timestamp behavior
- Store timestamp as integer (Unix nanoseconds) for programmatic access

The creation timestamp helps users understand artifact freshness, particularly
useful for AI models and other time-sensitive artifacts managed by tools like RamaLama.

Usage examples:
  podman artifact add myartifact:latest /path/to/file     # Creates with timestamp
  podman artifact inspect myartifact:latest              # Shows created annotation as integer
  podman artifact add --append myartifact:latest /file2  # Preserves original timestamp

Fixes: https://github.com/containers/podman/issues/27081
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-09-25 08:39:28 -04:00
a0238fb19f libpod: Fill out OnlineCPUs in the FreeBSD stats handler
Signed-off-by: Mark Johnston <mark.johnston@klarasystems.com>
2025-09-18 14:33:42 +00:00
2702156bd7 pkg/bindings: on terminal attach always wait for stdout to be done
Do not exit early just because stdin copy was done.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-12 19:13:47 +02:00
7ff07b6e0c pkg/bindings: use HTTP 101 upgrade request for attach
For exec and attach use an upgrade request which the server responds
with HTTP 101 status. Since go 1.12 the Body can be casted to an
io.Writer and then use that to write to the server.

This does however not allow us to skip the ugly hack of overwriting
the default dialContext() because the ReadWriterCloser on the body
does not allow us to call CloseWrite() which is critical to correctly
close the stdin side. So we still have to extract the underlying
net.Conn for that.

Using the cast response.Body is important because the underlying http
lib reads from the socket to parse the header and response code of
course and it is possible that it read more content than needed that is
kept in its buffer but because we then only directly read from the
connection it was possible we miss the first few bytes of the message.

This should fix the issue and hopefully also some long standing
podman-remote missing output flakes in CI.

Fixes: #26951

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-12 19:13:34 +02:00
998c9d8f6a Merge pull request #27014 from SquallATF/patch-1
fix(emulation): avoid nil pointer dereference in registeredBinfmtMisc
2025-09-11 10:29:48 +00:00
04af9ae3fc fix(emulation): handle fs.ErrNotExist in registeredBinfmtMisc
When `/proc/sys/fs/binfmt_misc` is not mounted, filepath.WalkDir may return
fs.ErrNotExist errors. These should be handled gracefully and return nil
instead of causing a panic.

Signed-off-by: Peiyuan Song <squallatf@gmail.com>
2025-09-11 16:56:13 +08:00
9e4fad8d06 pkg/systemd/quadletL silence one lint warning
t.Chdir() is not an exact replacement here

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-10 16:17:05 +02:00
8631032556 run modernize -fix ./...
Using golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize

+ some manual cleanup in libpod/lock/shm/shm_lock_test.go as it
  generated an unused variable
+ restored one removed comment

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-10 16:17:04 +02:00
b97525a78d use strings.SplitSeq where possible
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-10 16:17:04 +02:00
cf06546b7f Merge pull request #26877 from Honny1/build-speedup
refactor: Modularize binding build functions
2025-09-10 10:43:47 +00:00
936a01e088 Quadlet build - consider File path that starts with a systemd specifier as absolute
Fixes https://github.com/containers/podman/issues/26746

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-09-09 13:57:36 -04:00
c70c0ac13e refactor: Modularize binding build functions
- Split the monolithic Build() function into focused helper functions.
- Add a TempFileManager for proper temporary file lifecycle management.

This refactoring is in preparation for implementing a local build API.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-09-09 14:49:45 +02:00
8900d8e77b Merge pull request #26984 from Luap99/pflag
update module github.com/spf13/pflag to v1.0.10
2025-09-09 11:27:39 +00:00
9dd5fb2c99 Merge pull request #26950 from jiridostal/sigpipe-handler
Handle SIGPIPE to prevent machine stuck in Starting state
2025-09-08 14:12:54 +00:00
8566ef71c0 fix: set header fields before response status code to prevent missing fields
Signed-off-by: Anders Hausding <anders.hausding@siemens.com>
2025-09-08 09:06:36 +02:00
7a9d12b226 Merge pull request #26911 from Honny1/refactro-build-rest-api
refactor: modularize build REST API with utility functions
2025-09-05 13:30:57 +00:00
96abdfdec6 Merge pull request #26977 from jakmeier/fix-quadlet-mount-panic
quadlet: fix runtime error for invalid Mount value
2025-09-05 09:57:43 +00:00
2745c9e50e Merge pull request #26912 from markjdb/main
Fix several FreeBSD integration problems
2025-09-05 09:44:01 +00:00
163bdf2df8 quadlet: fix runtime error for invalid Mount value
If the `Mount` option inside a quadlet is missing the source=... part,
the code today panics with the following message.

```
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/containers/podman/v5/pkg/systemd/quadlet.handleStorageSource(0xc000140de0?, 0x1d?, {0x0?, 0x1?}, 0x5634e39e233e?, 0x10?)
...
```

This commit checks for the missing source and returns an error to avoid the panic.

Signed-off-by: Jakob Meier <mail@jakobmeier.ch>
2025-09-04 21:46:01 +02:00
43fbde4e66 kube play: don't follow volume symlinks onto the host
For ConfigMap and Secret kube play volumes podman populates the data
from the yaml. However the volume content is not controlled by us and we
can be tricked following a symlink to a file on the host instead.

Fixes: CVE-2025-9566

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-04 16:18:35 +02:00
c2506656c4 spf13/pflag: replace deprecated ParseErrorsWhitelist
Use ParseErrorsAllowlist instead, should still work the exact same.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-04 14:04:47 +02:00
98072bfcea refactor: modularize build REST API with utility functions
- Extract BuildQuery and BuildContext structs from inline definitions
- Split monolithic BuildImage into focused helper functions
- Add generic JSON parsing utilities (ParseOptionalJSONField, etc.)
- Introduce ResponseSender for consistent build response streaming

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-09-03 10:54:41 +02:00
5ba23ccad5 compat: Deduplicate the Linux and FreeBSD containers/stats helpers
Signed-off-by: Mark Johnston <mark.johnston@klarasystems.com>
2025-09-02 16:17:11 +00:00
a341a4ee24 compat: Add a stub container/stats handler for FreeBSD
The container/stats endpoint was unimplemented.  Copy over the structure
from the Linux endpoint handler, albeit with most of the stats
unpopulated.  This is similar to how "podman stats" returns very little
info on FreeBSD.  On the other hand, some orchestration tools will query
the stats endpoint to check liveness of a container, so it's useful to
implement it even though some fields are unimplemented for now.

Signed-off-by: Mark Johnston <mark.johnston@klarasystems.com>
2025-09-02 16:14:25 +00:00
59df0782f2 Handle SIGPIPE to prevent machine stuck in Starting state
Fixes: #26949
Signed-off-by: Jiri Dostal <jdostal@redhat.com>
2025-09-02 09:39:29 +02:00
428c854be6 Merge pull request #26932 from ogajduse/feature/quadlet-httpproxy-26925
quadlet: add HttpProxy option for Container sections
2025-09-01 16:04:15 +00:00
c65fd9a2c2 quadlet: add HttpProxy option for Container sections
Add support for HttpProxy key in quadlet Container sections to control
proxy environment variable inheritance during image pulls and builds.

- HttpProxy=true enables proxy inheritance (default podman behavior)
- HttpProxy=false disables proxy inheritance
- When omitted, uses podman's default behavior

This addresses the need for declarative proxy configuration in IPv6-only
networks and other scenarios where proxy settings need to be controlled
at the container level without manual workarounds.

Fixes #26925

Signed-off-by: Ondřej Gajdušek <ogajduse@redhat.com>
2025-09-01 13:45:06 +02:00
a98154a978 Switch common, storage and image to monorepo.
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2025-09-01 12:33:04 +02:00
68b6876481 Merge pull request #26895 from intirix/tcp-close
Add support for criu's tcp-close functionality.
2025-08-28 10:40:59 +00:00
9c3652c188 Add support for criu's tcp-close functionality.
Fixes: #26676
Signed-off-by: Jeff Mercer <jeff.mercer@gmail.com>
2025-08-27 18:52:34 -04:00
835c581c4b Merge pull request #26737 from arsenalzp/podman-26691
Podman wait condition for return of first container
2025-08-27 16:03:29 +00:00
5a2098cf61 windows: do not convert unconfined seccomp path
unconfined is a special value and not a path as such it must not be
converted otherwise --security-opt seccomp=unconfined fails as it tries
to access a file called unconfined.

Fixes: 3e8b2d7d96 ("Fix seccomp profile path on Windows")
Fixes: #26855

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-08-20 13:19:40 +02:00
aa006d195f Merge pull request #26854 from ninja-quokka/format_artifact_api_doc
[docs] Refactor Artifact API documentation
2025-08-19 12:49:43 +00:00
cfe4d46d89 Optimize image loading for Podman machines
Add support for loading images directly from machine paths to avoid
unnecessary file transfers when the image archive is already accessible
on the running machine through mounted directories.

Changes include:
- New /libpod/local/images/load API endpoint for direct machine loading
- Machine detection and path mapping functionality
- Fallback in tunnel mode to try optimized loading first

This optimization significantly speeds up image loading operations
when working with remote Podman machines by eliminating redundant
file transfers for already-accessible image archives.

Fixes: https://issues.redhat.com/browse/RUN-3249
Fixes: https://github.com/containers/podman/issues/26321

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-08-19 12:33:15 +02:00
0a9d5ca75d Skip JSON parsing for non-JSON error responses
Check Content-Type header before unmarshaling errors to avoid
unnecessary JSON parsing overhead for plain text responses.

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-08-19 12:33:15 +02:00
be0ad4a7aa [docs] Refactor Artifact API documentation
Add artifact tag to tags.yaml so API docs are ordered correctly
(alphabetically with libpod endpoints first).

Refactor artifact API documentation to be consistently formated.

Refactor some descriptions and summaries to be more accurate and user
friendly.

Signed-off-by: Lewis Roy <lewis@redhat.com>
2025-08-19 10:22:00 +10:00
3ca729a2fb fix: Correct small typo foce -> force
Signed-off-by: Lewis Roy <lewis@redhat.com>
2025-08-13 23:00:27 +10:00
f38e32760d feat: Add artifact remove --all option
Prior to this commit `artifact remove --all` was not supported on remote
clients.

This patch adds a new artifact API endpoint `artifact/remove` which can
either take a list of artifacts to remove or remove all artifacts by
setting all=true.

This patch removes the temporary warning message in the tunnel interface
implementation of ArtifactRm if `--all` was passed on the command line
and uses the new `artifact/remove` endpoint.

This patch also updates the `artifact remove` command both remote and
local to accept a list of artifacts to remove rather than limiting to
just one.

Signed-off-by: Lewis Roy <lewis@redhat.com>
2025-08-13 23:00:20 +10:00
9f7af81cf8 Merge pull request #26718 from ninja-quokka/machine_init_tls_verify
Add support for configuring tls verification with machine init
2025-08-09 16:25:14 +00:00
930cd25739 Feat: Add log_path support in containers.conf
Added log_path variable in containers/common, User sets default log path in containers.conf under the `[containers]` section.
The directory has to exist beforehand. Container logs go under this directory, sub-directories named with the container id
and inside the sub-directory a ctr.log file will be created where the container logs for the corresponding container will go.
This path can be overridden by using the `--log-opt` flag.

Signed-off-by: Joshua Arrevillaga <2004jarrevillaga@gmail.com>
2025-08-07 17:04:13 -04:00
a75f74b1d3 Fixes: #26691
Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
2025-08-06 22:34:18 +03:00
67ec2037c0 Add support for configuring tls verification with machine init
This patch adds a new --tls-verify flag to the `podman machine init`
sub command which matches many of our other commands. This allows the
user to optionally control whether TLS verification is enabled or
disabled for download of the machine image.

The default remains to leave the TLS verification decision to the
backend library which defaults to enabling it, this patch just
allows the user to explicitly set it on the CLI.

Fixes: #26517

Signed-off-by: Lewis Roy <lewis@redhat.com>
2025-08-05 21:02:28 +10:00
69f8f26d98 pkg/machine/e2e: remove build context skip
The machine images should contain a new enough podman on the server side
to support this so the skips can be removed.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-08-05 12:53:35 +02:00
0c4c9e4fbc Merge pull request #26682 from Devashish08/fix-empty-device-mode-error
Fix: Improve error message for empty device modes
2025-08-01 12:33:32 +00:00
b7b7839ad3 compat: remove deprecated VirtualSize
Since compat version 1.43 the VirtualSize field in the
GET /images/{name}/json, GET /images/json, and
GET /system/df responses is deprecated and will no
longer be included in API v1.44. Use the Size field
instead, which contains the same information.

Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-08-01 11:46:23 +02:00
0530a564a7 Fix: Improve error message for empty device modes in API requests
- Add specific check for empty device modes in ParseDevice function
- Change error message from 'invalid device mode: ' to 'empty device mode in device specification: <device>'
- Include full device specification in error message for better context
- Add test cases for empty device mode scenarios
- Resolves issue where '/dev/fuse::' provided unhelpful error message

Fixes #26629

Signed-off-by: Devashish08 <devashish.cs025@gmail.com>
2025-07-31 16:24:29 +00:00
0389651436 Merge pull request #26704 from shiavm006/fix-ancestor-filter-docker-compatibility
Fix ancestor filter to support Docker-compatible substring matching
2025-07-31 16:02:51 +00:00
23ebb7d94c feat: add Podman artifact support to Go bindings and remote clients
Add the Go bindings implementation necessary to support Artifacts.
Implement the tunnel interface that consumes the Artifacts Go bindings.

With this patch, users of the Podman remote clients will now be able to
manage OCI artifacts via the Podman CLI and Podman machine.

Jira: https://issues.redhat.com/browse/RUN-2714#

Signed-off-by: Lewis Roy <lewis@redhat.com>
2025-08-01 00:10:50 +10:00
610c4c7710 compat: GET /_ping return Builder-Version: 1
Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-07-31 10:17:52 +02:00
1963c6275e compat: remove GET /system/df BuilderSize
Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-07-31 10:17:50 +02:00