1517 Commits

Author SHA1 Message Date
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
3747e3db3f Merge pull request #24601 from meln5674/feature/remote-tls
Support (m)TLS API Socket
2025-09-30 16:19:14 +00: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
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
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
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
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
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
a98154a978 Switch common, storage and image to monorepo.
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2025-09-01 12:33:04 +02: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
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
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
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
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
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
b0e7a2ec9b compat: add shared-size par to GET /images/json
Related: https://issues.redhat.com/browse/RUN-2698

Signed-off-by: Nicola Sella <nsella@redhat.com>
2025-07-31 10:17:06 +02:00
b97937ecc4 Merge pull request #26276 from inknos/compat-get-images-json-empty-list-repotags
compat: GET /images/json returns [] instead of <none>:<none> in RepoTags and RepoDigest
2025-07-30 16:09:25 +00:00
eabb64ddaf Merge pull request #26666 from TomSweeneyRedHat/dev/tsweeney/buildah_v1.41.0
Bump Buildah to v1.41.0
2025-07-24 12:24:28 +00:00
e6f812c21e API server: drop inherit-labels/annotations for compat builds
Drop the inheritlabels and inheritannotations flags in the description
for the compat build endpoint, because the docker engine's build
endpoint doesn't recognize them.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-07-23 15:57:06 -04:00
ac99084d03 API handler: don't force the SkipUnusedStages flag
Don't force the SkipUnusedStages option one way or another when the
client doesn't specifically request one or the other, so that the server
can choose to use its default behavior.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-07-23 15:55:47 -04:00
55f4d2aa25 API handler: don't force the CompatVolumes flag
Don't force the CompatVolumes option one way or another when the client
doesn't specifically request one or the other, so that the server can
choose to use its default behavior.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-07-23 15:55:16 -04:00
db2baee9fa API handler: don't force the IdentityLabel flag
Don't force the IdentityLabel option one way or another when the client
doesn't specifically request one or the other, so that the server can
choose to use its default behavior.

Fixes #26669

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-07-23 15:54:47 -04:00
3e673591ad Update compat-volumes setting for remotes
The "compat-volumes" setting shouldn't be provided by the compat build
endpoint, the docker daemon's isn't expected to recognize it.

It is also a conditional boolean flag, so if it isn't specified by the
caller, don't send a value from a client to the server, so that the
server will be able to apply its own default.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-07-23 15:54:28 -04:00
a615dde1a5 build endpoint: document the "timestamp" flag
The "timestamp" flag has been around for ages, but we never documented
it in the API.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-07-23 15:53:07 -04:00
7517e3267a remote build: relay more new flags introduced in buildah 1.41
Wire up the source-date-epoch, rewrite-timestamp, and created-annotation
flags so that a client can correctly ask a server to honor them.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-07-23 15:52:43 -04:00
73f3e98947 Feat: send additional build contexts for remote builds
Fixed the --build-context flag to properly send files for remote builds. Previously
only the main context was sent over as a tar while additional contexts were passed as
local paths and this would cause builds to fail since the files wouldn't exist.

New changes modifies the Build API to use multipart HTTP requests allowing multiple
build contexts to be used. Each additional context is packaged and
transferred based on its type:
- Local Directories: Sent as tar archives
- Git Repositories: link sent to the server where its then cloned
- Container Images: Image reference sent to the server, it then pulls the image there
- URLs/archives: URL sent to the server, which handles the download

Fixes: #23433

Signed-off-by: Joshua Arrevillaga <2004jarrevillaga@gmail.com>
2025-07-23 11:34:38 -04:00
2f71314b4a Add CLI updates for inherit and unset annotations
Add CLI updates for --inheritannotations and --unsetannotations

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-07-23 10:36:22 -04:00
152849ebd2 libpod/build: add headers
Add `headers` for `/libpod/build`

Closes: https://github.com/containers/podman/issues/26440

Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-07-08 06:51:32 -07:00
87d88c3b09 Merge pull request #26432 from stefwalter/dont-html-escape-json
api: Don't HTML escape application/json responses
2025-06-30 14:47:55 +00:00
fed198eaf9 api: Don't HTML escape application/json responses
An HTTP response with Content-Type application/json does not need
to be HTML escaped. Doing this causes encoding issues in the Podman
REST API output as seen in the issue:

Fixes #17769

Remove the HTML escaping from Content-Type: application/json responses.

Signed-off-by: Stef Walter <stef@thewalter.net>
Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-30 12:54:19 +02:00
5786d5f846 fix new lint errors from the docker update
Some new deprecated fields, we still have to set them since clients
might still use them.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-27 16:35:40 +02:00
9d328d8782 pkg/api: remove deadcode
One might think Close() should be called but we are already using
Shutdown() which is the graceful way to stop the server so we don't
actually need Close().

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-26 19:37:13 +02:00
75bad52af5 remove unused ShouldRestart() code
Deadcode should that the ShouldRestart() API endpoint was never wired
into the router so the endpoint did not existed and the bindings called
a non existing endpoint which returnd 404 which the binding code
assumed means no restart.

As such remove all this code as it didn't do anything useful. And IMO
exposing a shouldrestart API always feeled wrong to me. The client
should not have to deal with this.

This commit does not change the behavior but it also does not make an
attempt to fix the broken restart handling with the rmeote client. Given
we do not seem to have any user reports about this it seems it is not
used.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-26 19:37:13 +02:00
494287518b Merge pull request #26467 from ygalblum/secret-create-ignore
Secret create - add ignore option to allow noop
2025-06-26 15:25:52 +00:00
683e9b2c94 Merge pull request #26434 from mheon/import_export
Add remote support for `podman volume import` and `podman volume export`
2025-06-25 19:48:14 +00:00
bfc327a08e Secret create - add ignore option to allow noop
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-06-24 15:43:38 -04:00
98876454cb Refactor volume import to support the remote client
As with `volume export`, this was coded up exclusively in cmd/
instead of in libpod. Move it into Libpod, add a REST endpoint,
add bindings, and now everything talks using the ContainerEngine
wiring.

Also similar to `volume export` this also makes things work much
better with volumes that require mounting - we can now guarantee
they're actually mounted, instead of just hoping.

Includes some refactoring of `volume export` as well, to simplify
its implementation and ensure both Import and Export work with
readers/writers, as opposed to just files.

Fixes #26409

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-06-23 13:42:22 -04:00
1f9893817b volumes: add new --uid and --gid option
they allow to override the owner of the volume.  Differently from
-o=uid= and -o=gid= they are not passed down to the mount operation.

Closes: https://issues.redhat.com/browse/RHEL-76452

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2025-06-18 15:33:09 +02:00