Commit Graph
570 Commits
Author SHA1 Message Date
Danish Prakash 1246f0ab8e Merge pull request #27481 from Retr0-XD/label
feat(kube play): flag to specify resources (pods, secrets, volumes) labels #26450
2026-10-08 11:20:10 +05:30
Jan Rodák fd25df818b compat stats: fix system_cpu_usage, precpu_stats, one-shot CPU%, and docs
- Read system_cpu_usage from /proc/stat (first 7 CPU fields, including idle) instead of cgroups.SystemCPUUsage(), matching Docker semantics.
- Use CPU values from GetContainerStats() instead of a second cgroup read to avoid a timing gap.
- Populate precpu_stats on stream=false with a 100 ms sampling pauseso the Docker CPU% formula returns a directionally correc snapshot. This only affects the compat per-container endpoint; podman-remote stats uses a separate libpod handler.
- Return cpu_stats.cpu as 0 for one-shot=true since the two samples are only milliseconds apart.
- Replace direct precpu copy instead of JSON marshal/unmarshal round-trip.
- Propagate errors via fmt.Errorf instead of logrus.Errorf, letting callers decide how to handle them. Parse errors in /proc/stat fields are hard errors instead of silently returning partial data.
- Document that --no-stream CPU% is a coarse ~100 ms snapshot; streaming gives 5-second interval readings.

Fixes: https://github.com/podman-container-tools/podman/issues/28761
Fixes: https://github.com/podman-container-tools/podman/issues/24730
Fixes: https://github.com/podman-container-tools/podman/issues/29912
Fixes: https://github.com/podman-container-tools/podman/issues/25709

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-10-07 13:19:53 +02:00
Sakthi Harish faf93bb0ca feat(kube play): add --label flag to specify resource labels
Adds a -l/--label CLI flag to podman kube play and wires it through
the API, bindings, and ABI so user-provided labels are applied to pods,
PVCs, and secrets created from Kubernetes YAML.

Key features:
- Labels are merged with YAML labels (CLI takes precedence)
- Validation uses Kubernetes qualified-name rules (RFC1123 subdomains)
- Value validation enforces 63-char limit and charset rules
- Separate merge and validate functions (SOLID principle)
- Uses maps.Clone for cleaner merging

Fixes:
- Removed incorrect annotations size limit from label validation
- Refactored to call annotations.IsQualifiedName for key validation
- Added proper documentation for max key length enforcement

Closes #26450

Signed-off-by: Sakthi Harish <sakthi.harish@edgeverve.com>
2026-10-06 13:45:32 +00:00
Rudraksha Singh 2ac2529bf7 compat: ignore dead and restarting status filters
Docker documents `dead` and `restarting` as valid values for the
`status` filter on `/containers/json`. Podman returns HTTP 500 when
either of them is used even though no Podman container can ever be in
those states.

Ignore these values in the compat API. If they are the only status
filters, return an empty list like Docker does. Invalid status values
still return an error.

The libpod API still rejects these values since they are Docker
specific. Update the libpod API docs to list the states Podman
actually supports.

Reference:
https://docs.docker.com/reference/api/engine/version/v1.51/#tag/Container/operation/ContainerList

Fixes: #28904
Signed-off-by: Rudraksha Singh <rudraksharss@gmail.com>
2026-09-29 00:21:19 +05:30
Jan Rodák 253e24f65e Merge pull request #28358 from aaron-ang/issue-17726-distribution-api
api: implement compat distribution inspect endpoint
2026-09-23 10:49:31 +02:00
Aaron Ang 3611b67505 api: implement compat distribution inspect endpoint
Fixes: #17726
Signed-off-by: Aaron Ang <aaron.angyd@gmail.com>
2026-09-22 21:14:45 -04:00
Matt Heon 109bd7acd2 Merge pull request #29791 from evanpurkhiser/codex/auto-update-filter
auto-update: Add container filters
2026-09-21 15:01:10 -04:00
Danish Prakash 196e082727 Merge pull request #28686 from mheon/exec_no_streams_auto_detach
Allow running exec with no attach streams requested
2026-09-22 00:02:59 +05:30
Matthew Heon 7487854f10 Allow running exec with no attach streams requested
This is a small Docker compat fix with the API exec endpoints.
With Docker, sending a bare Exec Create (command only, nothing
else set) and then an Exec Start without Detach set performs
a detached exec. With Podman, we threw an error that at least one
stream must be attached to. Fix is trivial; look up the session
before start, check the config for attach streams, and force
detach on if none are set.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2026-09-21 10:34:55 -04:00
Oleksandr Krutko ff2eb1b0ca The feature which allows multiple Pods creation
Fixes: #26769

Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
2026-09-20 15:41:06 +03:00
Evan Purkhiser 9309b9183c auto-update: Add container filters
Allow deployments and scheduled jobs to update a selected group of
containers without checking every auto-update-enabled application.
Reuse the existing container filters and expose them through the CLI,
remote bindings, and REST API.

Filter update candidates while preserving systemd unit and pod restart
behavior. Document the selection semantics and cover filtered updates,
invalid input, remote requests, and pod restarts in the existing tests.

Signed-off-by: Evan Purkhiser <git@evanpurkhiser.com>
2026-09-17 11:16:58 -04:00
Jan Rodák fda861989d Merge pull request #29395 from scallaway/image-scp-compression
image scp: add --compression-format and --compression-level
2026-09-17 17:09:06 +02:00
Stefan Nienhuis 9c923c019e feat: Implement auto update support for podman-remote
Signed-off-by: Stefan Nienhuis <stefan@nienhuisdevelopment.com>
2026-09-17 11:08:24 +02:00
Paul Holzinger 687c5e644a Merge pull request #29525 from sahilnyk/exec-sigproxy-pgid
exec: forward signals to the exec session's process group
2026-09-14 13:32:46 +02:00
Sahil Nayak 903a1b6cb6 exec: forward signals to exec sessions over local and remote
Fixes: #19486
Signed-off-by: Sahil Nayak <contactsahilpnayak@gmail.com>
2026-09-11 21:32:26 +05:30
Scott Callaway 79b35ad0d9 image scp: accept --compression-format=none
Until now the default could only be expressed by leaving the option off, which
reads as an omission rather than a choice and gives a script no way to say it
wants the archive transferred as podman save wrote it.

Accept none as a format meaning exactly that. It is taken on the API path too,
so both interfaces share one vocabulary, and it is treated as the absence of a
format throughout: nothing is compressed, a level attached to it is rejected the
same way a level with no format is, and the local user to user transfer has
nothing to warn about ignoring.

The remote client still leaves it off the request, so naming the default does
not make a transfer fail against a service that predates these options.

Signed-off-by: Scott Callaway <github@scottcallaway.co.uk>
2026-09-10 16:45:30 +01:00
Scott Callaway 8d5b091a45 image scp: pass the compression options over the remote API
The tunnel engine builds its own ScpOptions, so without this the flags parse
fine under podman --remote and are then dropped, transferring uncompressed with
no indication that anything was ignored.

Carry both options through the bindings to the libpod ImageScp handler, which
hands them to ExecuteTransfer the same way the local path does, and document
them on the endpoint.

This is also the point at which the transfer's own validation becomes reachable
over HTTP, so map it accordingly: a rejected format or level is the caller's
mistake and answers 400, not the 500 every error from the transfer used to
produce.

Signed-off-by: Scott Callaway <github@scottcallaway.co.uk>
2026-09-07 16:03:54 +01:00
Paul Holzinger 8b216d16c4 Merge pull request #29656 from hkwi/fix-compat-stats-http-status
api: reflect container stats errors in HTTP status codes
2026-09-04 15:17:42 +02:00
Hiroaki KAWAI d56f52c8a7 api: reflect container stats errors in HTTP status codes
Existing KillContainer handling uses HTTP status code 409 when the request cannot be performed because of the current container state. HTTP status code 404 is also used when the target container does not exist.

In contrast, errors from the stats handler are not reflected in the HTTP status code. The HTTP status code is always 200, and the errors are recorded only as generic errors in the server log.

To maintain compatibility with both streaming enabled and disabled, this change treats obtaining at least one complete unit of response content as the response contract. It then keeps the response content consistent with the HTTP status code.

Signed-off-by: Hiroaki KAWAI <hiroaki.kawai@gmail.com>
2026-09-04 20:42:55 +09:00
Jan Rodák ec30171911 Merge pull request #29660 from simek-m/RUN-3316-compat-until-filter
compat: Document and test GET /images/json until filter
2026-09-04 11:45:24 +02:00
Ashley Cui af579ec299 Add --platform to podman push
When pushing a manifest list, --platform=OS[/Arch[/Variant]] selects and pushes a single platform-specific manifest instead of the entire list.
Also, update compat POST /images/{name}/push to support the platform param (Compat v1.46)

Signed-off-by: Ashley Cui <acui@redhat.com>
2026-09-01 11:30:48 -04:00
Marek Simek d6c2cf29dd compat: Document and test GET /images/json until filter
The `until` filter was missing from the documentation.
Document it for both GET /libpod/images/json and the
compat GET /images/json.

Add tests for the until filter exercising both endpoints.

Fixes: https://redhat.atlassian.net/browse/RUN-3316
Signed-off-by: Marek Simek <msimek@redhat.com>
2026-08-31 12:11:36 +02:00
Anisha Khairnar c1e2ece120 pkg/api/server: drop duplicate generate/kube swagger operation
Signed-off-by: Anisha Khairnar <anishakhairnar284@gmail.com>
2026-08-19 23:39:01 +05:30
Anisha Khairnar baddf266c1 pkg/api/server: document missing manifest push and create params
The manifest push and create endpoints accept query parameters that
were never documented, so API users can't discover them.

Push was missing compressionFormat, compressionLevel, format and
removeSignatures. Create was missing annotation and annotations.
The wording matches the same parameters on the image push endpoint.
The deprecated v3 push and add endpoints are left alone.

Signed-off-by: Anisha Khairnar <anishakhairnar284@gmail.com>
2026-08-18 12:39:30 +05:30
Matt Heon a2409076ef Merge pull request #29523 from ROKUMATE/docs-swagger-kube-play-params
pkg/api/server: document noHostname and noPodPrefix kube play params
2026-08-14 18:36:10 -04:00
ROKUMATE 0928ec5376 pkg/api/server: document noHostname and noPodPrefix kube play params
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-08-14 15:56:02 +05:30
nXtCyberNet f76d9de01a added errorlint
Fixes: #29488
Signed-off-by: nXtCyberNet <rohantech2005@gmail.com>
2026-08-14 01:35:03 +05:30
Matt Heon cbd17f7459 Merge pull request #29473 from ROKUMATE/swagger-checkpoint-createimage
pkg/api: document the createImage checkpoint query parameter
2026-08-12 10:26:11 -04:00
ROKUMATE 944fa71129 pkg/api: document the createImage checkpoint query parameter
Fixes: #29472
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-08-12 17:33:54 +05:30
Matt Heon 55c2d1c490 Merge pull request #25161 from danishprakash/empty-ignore-file
build: pass ignore file to buildah to consider empty ignore files
2026-08-07 07:57:30 -04:00
Matt Heon 0ad5459fab Merge pull request #29145 from ROKUMATE/feat-playkube-warn-unknown-keys
podman kube play: add --validate=ignore|warn|strict flag
2026-08-06 18:21:03 -04:00
ROKUMATE 0d09e609e4 add validate flag to podman kube play
ignore warn and strict modes for unknown yaml fields and kinds
ignore is the default and skips them warn reports them strict fails
warnings are returned in the play report so they show up in the cli and over the api for tools like podman desktop

Closes #18332

Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-08-05 17:42:40 +05:30
Jan Rodák bb4695870e Merge pull request #28984 from stefan8/test/apiv2-manifest-create-images-query
test: add apiv2 coverage for the manifest-create images query param
2026-07-15 13:10:40 +02:00
Marek Simek f4925bae8c api: Deprecate is-automated filter and field in GET /images/search endpoint
The Docker API in version 1.44 deprecates the is_automated field for
the GET /images/search endpoint. The is_automated field has been deprecated
by Docker Hub's search API. Consequently, searching for is-automated=true
will yield no results.

The Docker API in version 1.44 deprecates the is_automated field
in the GET /images/search response and will always be set to false in the
future because Docker Hub is deprecating the is_automated field in its search API.

Return struct moby/api for the compat endpoint that matches the Docker
API response format and deprecates is_automated.

Update test_v2_0_0_image.py::ImageTestCase::test_search_compat
to verify returned format and fix subtests not being asserted (remove mp).

Fixes: https://redhat.atlassian.net/browse/RUN-3323

Signed-off-by: Marek Simek <msimek@redhat.com>
2026-07-08 17:31:02 +02:00
Danish Prakash 7be083cc66 build: pass ignore file to buildah to consider empty ignore files
We currently only pass parsed excludes from the ignore file to buildah
and not the ignorefile path. This causes buildah to ignore
`--ignorefile` if the specified file is empty resulting in an empty
exludes. Forward ignoreFile to the server and allow overriding default
ignore files.

Signed-off-by: Danish Prakash <contact@danishpraka.sh>
2026-07-02 20:24:11 +05:30
Grzegorz Szczepanczyk 11daf5068a test/apiv2: cover the manifest-create images query param
The libpod manifest-create endpoint takes an "images" query parameter that
fills the new list at creation time, but 15-manifest.at never tested it.
Add cases that create a list with images= on both the v4
(/manifests/{name}, 201) and v3 (/manifests/create, 200) endpoints and
check the image ends up in the list.

Also drop the stale "required: true" from the images query parameter in the
swagger docs - the handler treats it as optional, and the existing create
tests (which omit it) already show that.

Fixes: #22258

Signed-off-by: Grzegorz Szczepanczyk <g.szczepanczyk@getprintbox.com>
2026-06-29 12:01:34 +02:00
Matt Heon 9a70aa562d Merge pull request #28860 from l0rd/refactor/quadlet-applications-with-fix
Quadlet installation code refactoring
2026-06-25 13:45:29 -04:00
Paul Holzinger aef1dfad28 update version in swagger.yml
We did not do breaking API changes but it seems confusing to have the
latest docs open and it still says API v5.0.0.

And while at it update the logo link.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-06-23 19:11:11 +02:00
Šimon Brauner 010e7ce556 Handle uninstantiated template quadlets
Fixes: https://github.com/containers/podman/issues/26960

Signed-off-by: Šimon Brauner <sbrauner@redhat.com>
2026-06-23 14:34:20 +02:00
Paul Holzinger 4ae189843b Merge pull request #28637 from ValentinTorassa/manifest-push-retry-options
Add --retry support to manifest push
2026-06-23 12:00:03 +02:00
KyounghoonJang 9e38f86993 feat: add --ignore flag to network rm
Add `--ignore` to `podman network rm` so removing a missing
network returns success instead of exit code 1.

Keep existing error behavior for networks in use and other failures.

This commit message was translated from Korean to English using an LLM.

Fixes: #28363
Signed-off-by: KyounghoonJang <matkimchi_@naver.com>
2026-06-23 10:52:47 +09:00
Valen Torassa 72349937e3 Add --retry support to podman manifest push
This patch adds retry plumbing for podman manifest push.

CLI flags added: --retry and --retry-delay
Flags are read into ImagePushOptions and passed through the local ABI path
Remote clients and REST API now respect retry settings (retry / retryDelay)
retry-delay is parsed with time.ParseDuration
Defaults fall back to containers.conf when the flags are not set
Updated manpages, Swagger comments, and e2e tests to validate retry behavior

Fixes: #28590

Signed-off-by: Valen Torassa <valentintorassacolombero@gmail.com>
2026-06-22 15:49:27 -03:00
Mario Loriedo d1e2692069 Quadlet installation code refactoring
- Cleanup the code to install quadlets
- Fix `podman quadlet install` output message (see https://github.com/podman-container-tools/podman/pull/28335#discussion_r3310372000)
- Update libpod quadlet endpoint documentation

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2026-06-16 12:28:58 +00:00
MayorFaj d01b7ae534 libpod: add volume rename support
Add a podman volume rename command, REST API endpoint, and bindings for renaming volumes.

The rename updates both the VolumeConfig and VolumeState tables in a single transaction and moves the volume directory on disk, rolling back if the transaction fails. Renaming an anonymous volume converts it to a named volume. Volumes that are in use, mounted, or backed by a volume plugin or the image driver cannot be renamed.

Fixes: #28189
Signed-off-by: MayorFaj <mayorfaj@gmail.com>
2026-06-11 21:56:15 +01:00
Tom Sweeney 8b1e46170b Adjust API calls for compression
Add the various compression API calls as created by @nalind in #28807

Signed-off-by: Tom Sweeney <tsweeney@redhat.com>
2026-05-29 09:10:50 -04:00
Jan Rodák 5b98ee331f Merge pull request #28641 from jiwahn/feat/container-annotation-filter
Feat/container annotation filter
2026-05-26 12:00:40 +02:00
Matt Van Horn f2a51888f3 docs(api): drop trailing slash on podman.io/community contact URL
The swagger spec generated from pkg/api/server/doc.go sets the contact
URL to https://podman.io/community/. That URL now returns 404, while
https://podman.io/community (no trailing slash) returns 200 and is what
the live site links to from its own navigation. Issue #28298 reports
the link as broken at the top of the rendered API reference, which is
where ReDoc surfaces the contact field.

Drop the trailing slash so the contact link in the generated swagger
spec resolves.

Signed-off-by: Matt Van Horn <mvanhorn@gmail.com>
2026-05-19 02:48:35 -07:00
KyounghoonJang 3d899a8c25 volume prune: add dry-run support
Add a --dry-run option to show which volumes would be pruned without removing them.

Related: #27838
Signed-off-by: KyounghoonJang <matkimchi_@naver.com>
2026-05-16 19:03:34 +09:00
Jiwoo Ahn ec583fa17f filters: add annotation filter for containers Fixes: #28562
Signed-off-by: Jiwoo Ahn <ikwydls1314@gmail.com>
2026-05-11 20:24:28 +09:00
Brent Baude 2cc3be7332 RUN-4539: Change podman module paths
The podman module paths are moving from github.com/containers/podman to
go.podman.io/podman.  This will help with future mobility.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-04-22 14:02:25 -05:00