6991 Commits

Author SHA1 Message Date
7fecff5c29 Merge pull request #27239 from Honny1/fix-mapping-ns
Fix --userns=ns:<path> conflicting with runc 1.1.11+
2025-10-07 19:21:01 +00:00
2455ac327d Merge pull request #27153 from rhatdan/cursor
Add --replace option to podman artifact add command
2025-10-07 17:09:03 +00:00
79ecc1d56b Fix --userns=ns:<path> conflicting with runc 1.1.11+
Remove dummy UID/GID mappings added when joining existing user
namespaces, which runc 1.1.11+ rejects as conflicting.

RUNC fix: https://github.com/opencontainers/runc/pull/4124

Fixes #27148

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-10-07 15:45:45 +02:00
98cb7b75d9 quadlet: standardize Convert function signatures
Remove unused 'name' parameter from ConvertPod and reorder ConvertContainer
parameters to match other Convert functions (unitFile, unitsInfoMap, isUser).

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-10-06 18:26:47 +02:00
b765c91580 Add --replace option to podman artifact add command
This commit implements the --replace functionality for the artifact add command,
allowing users to replace existing artifacts without having to manually remove
them first.

Changes made:
- Add Replace field to ArtifactAddOptions entity types
- Add --replace CLI flag with validation to prevent conflicts with --append
- Implement replace logic in ABI backend to remove existing artifacts before adding
- Update API handlers and tunnel implementation for podman-remote support
- Add comprehensive documentation and examples to man page
- Add e2e and system BATS tests for --replace functionality
- Fix code formatting in pkg/bindings/artifacts/types_pull_options.go:
  * Reorder imports with proper spacing
  * Fix function declaration spacing
  * Convert spaces to proper tab indentation
  * Remove extraneous blank lines

The --replace option follows the same pattern as other podman replace options
like 'podman container create --replace' and 'podman pod create --replace'.
It gracefully handles cases where no existing artifact exists (no error thrown).

Usage examples:
  podman artifact add --replace quay.io/myimage/artifact:latest /path/to/file
  podman artifact add --replace localhost/test/artifact /tmp/newfile.txt

Fixes: Implements requested --replace functionality for artifact add command
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-10-06 12:22:40 -04:00
09e535fb46 quadlet: remove unused 'name' parameter from ConvertNetwork and ConvertVolume
The 'name' parameter was unused in both ConvertNetwork and ConvertVolume functions.
Remove the parameter entirely and update all function calls accordingly.

This fixes revive linter warnings:
- pkg/systemd/quadlet/quadlet.go:961:47: unused-parameter: parameter 'name' seems to be unused
- pkg/systemd/quadlet/quadlet.go:1050:45: unused-parameter: parameter 'name' seems to be unused

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-10-06 14:00:49 +02:00
8daac5220c Merge pull request #25647 from aguidirh/fix/issue-23915
fix: #23915 podman build is not parsing sbom command line arguments
2025-10-06 10:16:24 +00:00
4bd6aff4b6 fix: #23915 podman build is not parsing sbom command line arguments
Signed-off-by: Alex Guidi <aguidi@redhat.com>

add sbom flags on server side for podman-remote

Signed-off-by: Alex Guidi <aguidi@redhat.com>
2025-10-03 22:28:36 +02:00
ef584d4d6d Merge pull request #27169 from ygalblum/quadlet-template-dependency
Quadlet - Support template dependency
2025-10-03 15:51:31 +00:00
0a58e05a68 Merge pull request #27142 from nothiaki/feat-artifact-rm-ignore
Feat artifact rm ignore
2025-10-03 15:45:28 +00:00
089d153fb6 Merge pull request #27203 from nothiaki/quadlets-api-resource
pkg/api: api list quadlets resource
2025-10-03 12:59:32 +00:00
b415b0ad3e Update pkg/api/server/register_artifacts.go
Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Celso Henrique <86984438+nothiaki@users.noreply.github.com>
2025-10-02 20:23:15 -03:00
a724fce8aa pkg/api: api list quadlets resource
Signed-off-by: Celso Henrique Souza Silva <celsohenrique367@gmail.com>
2025-10-01 21:10:36 -03:00
3c3b805ea7 cmd/podman: --ignore errors flag to artifact rm
Signed-off-by: Celso Henrique Souza Silva <celsohenrique367@gmail.com>
2025-10-01 18:22:26 -03:00
090304a054 lint: reenable revive unused-parameter check
Signed-off-by: Matt Souza <medsouz99@gmail.com>
2025-10-01 10:42:08 -04:00
83e65f91a4 Quadlet - Support template dependency
Add support for Volumes and Networks
Add e2e and system tests

Resolves: https://github.com/containers/podman/issues/25136

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-09-30 13:41:20 -04:00
3747e3db3f Merge pull request #24601 from meln5674/feature/remote-tls
Support (m)TLS API Socket
2025-09-30 16:19:14 +00:00
87b4f842de test: fix "run healthcheck" bindings test
Signed-off-by: ByoungUk Lee <nimdrak@gmail.com>
2025-09-30 22:58:34 +09:00
ef0a7dd486 pkg/api/handlers/compat: use strings.CutPrefix
This way we don't check the string twice.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-09-29 22:17:51 -07:00
f198fe6b13 pkg/machine/wsl: use any instead of interface{}
Since Go 1.18, any is a type alias for interface{}. After commit 8631032556
there is still one last instance of interface{} left -- replace it
manually.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-09-29 22:11:39 -07:00
5824197774 pkg/machine/e2e: remove obsoleted comment
The code which comment refers to was removed by commit 2e4e1bb97c
("podman machine ssh handling"), so the comment is no longer valid.

Remove it.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2025-09-29 22:05:58 -07:00
e57a7f3694 Merge pull request #27172 from ninja-quokka/docker_compate_145
[compat api] Remove ContainerConfig field
2025-09-29 13:45:07 +00:00
571866775d [compat api] Remove ContainerConfig field
ContainerConfig has been removed from v1.45

InspectResponse.Container has also been removed but it seems we never implemented it.

Ref: https://docs.docker.com/reference/api/engine/version-history/#v145-api-changes
Signed-off-by: Lewis Roy <lewis@redhat.com>
2025-09-27 20:50:30 +10:00
feb36e4fe6 Implement TLS API Support
* Added flags to point to TLS PEM files to use for exposing and connecting
  to an encrypted remote API socket with server and client authentication.
* Added TLS fields for system connection ls templates.
* Added special "tls" format for system connection ls to list TLS fields
  in human-readable table format.
* Updated remote integration and system tests to allow specifying a
  "transport" to run the full suite against a unix, tcp, tls, or mtls
  system service.
* Added system tests to verify basic operation of unix, tcp, tls, and mtls
  services, clients, and connections.

Signed-off-by: Andrew Melnick <meln5674.5674@gmail.com>
2025-09-26 09:09:54 -06:00
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