Commit Graph

758 Commits

Author SHA1 Message Date
ROKUMATE
f30dda3837 pkg/bindings: add tests for ToParams and helpers
Fixes: #28930
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
2026-06-26 17:05:40 +05:30
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
Matt Heon
df12c9806c Merge pull request #28214 from MayorFaj/feat/28189-volume-rename
feat: implement volume rename functionality
2026-06-18 14:47:35 -04:00
Brent Baude
0cba15e256 Merge pull request #28910 from Honny1/fix-hang
Fix client hangs on stale SSH connections
2026-06-15 13:01:31 -05:00
Jan Rodák
454a1dea45 Replace deprecated PatternMatcher.Matches with MatchesResult
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-06-12 10:12:49 +02:00
Jan Rodák
b294a92a25 Add reasons to all staticcheck suppressions
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-06-12 10:12:40 +02: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
Jan Rodák
ae825f6234 Fix client hangs on stale SSH connections
Wrap ssh.DialNet in a goroutine so it respects context cancellation,
skip retries on context/timeout errors, and invalidate the cached
connection on failure.

Fixes: https://github.com/containers/podman/issues/28453

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-06-11 16:10:25 +02:00
Jannik Glückert
b0cb2bb011 fix ssh config parsing for HostName
A later invocation to url.Parse() needs a preceding scheme,
otherwise the hostname just gets discarded.

Fixes #25067

Signed-off-by: Jannik Glückert <jannik.glueckert@gmail.com>
Signed-off-by: KILA <32559459+kila-star1127@users.noreply.github.com>
2026-06-05 18:10:07 +00: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
Paul Holzinger
13c6b5d786 pkg/bindings/generator: fall back to golangci-lint from $PATH
Commit cf021c4ba9 switched the logic to also allow golangci-lint in
$PATH but forgot to update the call here.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-05-28 20:38:49 +02:00
Kir Kolyshkin
7f7b35356f Replace os.Is* error checks with errors.Is
Using os.Is{Exist,NotExist,Permission} checks is not recommended in the
new code (see official documentation). While using it in the existing
code is OK, it may still result in a subtle errors later (for a specific
example of that, see [1]).

Replace those with errors.Is.

Generated by:

	gofmt -r 'os.IsExist(a) -> errors.Is(a, os.ErrExist)' -w .
	gofmt -r 'os.IsNotExist(a) -> errors.Is(a, os.ErrNotExist)' -w .
	gofmt -r 'os.IsPermission(a) -> errors.Is(a, os.ErrPermission)' -w .
	goimports -w .
	git diff vendor test/tools/vendor | patch -p1 -R

[1]: https://github.com/opencontainers/runc/pull/5061
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-05-21 13:09:42 -07:00
Jan Rodák
517070e750 Merge pull request #28673 from kyounghunJang/feat/add-volume-prune-dry-run
volume prune: add dry-run support
2026-05-18 19:26:18 +02:00
Byounguk Lee
e36e2c97d2 bindings/artifacts: remove redundant nameOrID parameter from Remove for 6.0
Signed-off-by: Byounguk Lee <nimdrak@gmail.com>
2026-05-17 08:11:53 +00: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
Ashley Cui
462b24479b Use tmp context dir when building with process substitution
Podman defaults to the directory of the Containerfile when no context dir is explicitly provided.
When running podman build with process subsituiton,  `podman build -f <(echo "FROM scratch")`,
the Containerfile path expands to `/dev/fd/<NUM>`, which makes `/dev/fd` the context dir.
When building, Buildah attempts to create an overlay mount on top of the `/dev/fd` context dir, which fails.

In these cases, use a temp context dir instead: `$TMPDIR/podman-build-context-$randnum`

Fixes: https://github.com/containers/podman/issues/28113

Signed-off-by: Ashley Cui <acui@redhat.com>
2026-05-08 10:39:38 -04:00
Jan Rodák
d5b4685cc8 Fix lint issue with replace reflect.Ptr with reflect.Pointer
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-05-04 13:48:36 +02: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
Brent Baude
2e6f29a2df RUN-4538: Fix buildah vendoring
This PR reflects the upstream change of moving the buildah module from
github.com/containers/buildah to go.podman.io/buildah.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-04-21 14:27:58 -05:00
Matthew Heon
efba9996f6 Implement --save-stages/--stage-labels for build
These are two new Buildah flags that we need to wire into Podman
(both local and remote) and document, with the interesting note
that one requires the other and a check needed to be added for
that.

Also: secret parsing was tightened up in Buildah, and was
breaking the remote build tests. Rewire it to use the new parser
Buildah made, which ends up simplifying the code considerably.
Tests are back to passing afterwards.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2026-04-17 10:00:32 -04:00
Paul Holzinger
5ae63471cf Merge pull request #28469 from Luap99/fixes
some small fixes
2026-04-09 13:36:36 +02:00
Paul Holzinger
12bec19426 bindings: artifact extract reject invalid names
The server already does validate this so this is not strictly needed and
the client must trust the server no matter what.

But adding an extra check here does not hurt and may help prevent future
bugs.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-04-08 19:58:08 +02:00
Jan Rodák
e18bb9ea8b Remote build: nTar secrets with relative paths and ignore bypass
When `podman-remote` tars the context, extra `podman-build-secret*` paths were
either dropped by `.dockerignore` (#25314) or archived as absolute paths so
`COPY . .` pulled host-shaped trees into the image (#28334).

Use relative names under the primary context for extra sources and do not apply
`.dockerignore` to those forced entries.

Fixes: https://github.com/containers/podman/issues/25314
Fixes: https://github.com/containers/podman/issues/28334

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-25 15:02:28 +01:00
Paul Holzinger
0147339e8e Merge pull request #28202 from lsm5/podman6-no-cni-vendor
Podman6: Vendor update w/o CNI + additional cleanups
2026-03-19 21:44:01 +01:00
Lokesh Mandvekar
7d50844922 test: remove CNI_CONFIG_DIR env var handling
The CNI_CONFIG_DIR environment variable is no longer relevant now
that CNI support has been removed.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-03-19 20:26:21 +05:30
Jan Rodák
339acf880c volume prune: match Docker default and add --all
Fixes: https://github.com/containers/podman/issues/24597
Fixes: https://issues.redhat.com/browse/RUN-4404

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-03-19 13:40:45 +01:00
Jan Kaluza
56e555bfc2 api/compat: switch to moby/moby
Replace github.com/docker/docker API imports with github.com/moby/moby
across compat handlers, swagger models, and tests to align with upstream
type definitions.

Fixes: #27536.

Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2026-03-09 11:09:23 +01:00
Miloslav Trmač
2d4fb908a1 Pass all of Options to tcpClient
This will make it easier to add one more option,
and removes a risk of passing options in an incorrect order.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2026-03-02 23:17:12 +01:00
Paul Holzinger
a3198235bf bindings: do not validate source policy on the client
The client and server version can mismatch in which case the client may
fail on something the newer server can understand or the other way
around. Given the server has to parse and validate that output no matter
what there does not seem to be a strong argument for doing this on the
client side again.

Also this means we do leak the sourcepolicy package into the remote
client.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-02-18 14:18:44 +01:00
Nalin Dahyabhai
474ff994b6 build: connect --source-policy-file, --mount for remote builds
Pass --mount settings and the contents of the --source-policy-file
argument to remote builds.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-02-18 14:11:12 +01:00
Matt Heon
cb67dafd36 Merge pull request #26445 from aaron-ang/update-ulimit
Add ulimits to `podman update`
2026-01-16 08:38:00 -05:00
shiavm006
90f45bca77 extract shared TTY handling code into helper function
Signed-off-by: shiavm006 <shivammittal42006@gmail.com>
2026-01-07 10:19:38 +05:30
Paul Holzinger
254403dc03 Merge pull request #27426 from Honny1/local-api-artifact-add
Artifact add optimization on macOS and Windows
2025-12-12 16:49:50 +01:00
ZuhairM7
fdbb696731 bindings: fix handling of env secrets in remote builds
Previously, using --secret=id=foo,env=BAR in remote mode would fail because the client sent the env var name to the server, which tried to resolve it locally. This patch modifies the client to resolve the environment variable locally, write it to a temp file, and send it as a file-based secret.

Fixes #27494

Signed-off-by: ZuhairM7 <ZuhairM7>
Signed-off-by: ZuhairM7 <zuhairmerali@gmail.com>
2025-12-02 16:21:49 -06:00
Aaron Ang
e0fc51eb68 Add ulimits to podman update API
Signed-off-by: Aaron Ang <aaron.angyd@gmail.com>
2025-11-20 22:59:50 -08:00
Jan Rodák
91af437471 Add local artifact add API endpoint
Fixes: https://issues.redhat.com/browse/RUN-3385
Fixes: https://github.com/containers/podman/issues/26321

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-11-19 18:20:29 +01:00
Lokesh Mandvekar
a3fcf52a1c Fix deprecation notice to make gocritic happy.
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:35:29 -05:00
Paul Holzinger
5c1ed12d8d enable gofumpt formatter
Based on our discussion gofumpt won the vote so use that one via
golangci-lint.

https://github.com/containers/podman/discussions/27291

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-11-11 12:32:46 +01:00
shiavm006
c0ae1a9bac Fix remote client rejecting empty --detach-keys string
The remote client (podman --remote) was incorrectly throwing an error
when --detach-keys="" was specified for attach, run, or start commands.
According to documentation and the v1.7.0 release notes, specifying an
empty string should disable detaching, not cause an error.

Fixes: #27414

Signed-off-by: shiavm006 <shivammittal42006@gmail.com>
2025-11-04 09:12:02 +05:30
Matt Heon
34166fc004 Bump Go version to v6
Tremendous amount of changes in here, but all should amount to
the same thing: changing Go import paths from v5 to v6.

Also bumped go.mod to github.com/containers/podman/v6 and updated
version to v6.0.0-dev.

Signed-off-by: Matt Heon <mheon@redhat.com>
2025-10-23 11:00:15 -04:00
openshift-merge-bot[bot]
b342596e1c Merge pull request #27269 from Honny1/fix-unmarshal-prunereport
fix: system prune JSON unmarshalling error in remote client
2025-10-21 15:15:57 +00:00
openshift-merge-bot[bot]
9146ef6ac0 Merge pull request #27302 from arsenalzp/podman_26396
Add option to remove Pod name prefix in resulting container name
2025-10-20 23:47:40 +00:00
Oleksandr Krutko
bb4fa066b3 fix remote command parameters
Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
2025-10-18 02:08:51 +03:00
Lokesh Mandvekar
74788a3fe1 fileperms: newer Go 1.13+ octal literal format
Problem: While removing cgroupsv1 code, I noticed my neovim Go config
automatically changed fileperms to the new octal format and I didn't
want that polluting my diffs.

Decision: I thought it best to switch to the new octal format in a dedicated PR.

Action:
- Cursor switched to new octal format for all fileperm ocurrences in Go
 source and test files.
- vendor/, docs/ and non-Go files were ignored.
- Reviewed manually.

Ref: https://go.dev/ref/spec#Go_1.13

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-10-16 14:11:29 -04:00
Jan Rodák
56fee79d3c fix: system prune JSON unmarshalling error in remote client
Add custom JSON methods to PruneReport to handle error field marshalling.

Fixes: https://github.com/containers/podman/issues/27267

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-10-14 14:33:12 +02:00
Jan Rodák
a1e7e9a46d Add local build API for direct filesystem builds on MacOS and Windows (only WSL)
Adds /libpod/local/build endpoint, client bindings, and path translation
utilities to enable container builds from mounted directories to podman machine without tar uploads.

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

Fixes: https://issues.redhat.com/browse/RUN-3249

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-10-09 15:14:48 +02:00
Daniel J Walsh
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
openshift-merge-bot[bot]
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
Alex Guidi
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
openshift-merge-bot[bot]
0a58e05a68 Merge pull request #27142 from nothiaki/feat-artifact-rm-ignore
Feat artifact rm ignore
2025-10-03 15:45:28 +00:00