Commit Graph

7202 Commits

Author SHA1 Message Date
Miloslav Trmač
a37bf83dfc Also set DestinationCtx in a copy
It shouldn't actually affect anything, but it's easier
to set it than worry.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2026-03-02 23:17:13 +01:00
Miloslav Trmač
e04b77e600 Consolidate the call to bindings.NewConnectionWithOptions
... to centralize the conversion from entities.PodmanConfig
to bindings.Options, we will add more code there.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2026-03-02 23:17:13 +01:00
Miloslav Trmač
fd86c3c25f Use pullOptions.systemContext in getDestArtifact
Right now, this correctly handles pullOptions.credentials
which were ignored previously (admittedly that field is never set
by anything...); in the future, it will ensure the two c/image users
won't get out of sync again.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2026-03-02 23:17:12 +01:00
Miloslav Trmač
5946f7afcf Factor out pullOptions.systemContext from pull
We will add another user.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2026-03-02 23:17:12 +01:00
Miloslav Trmač
e807ae4350 Make ocipull.Pull and PullOptions private
There are no external users, so make that clearer.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2026-03-02 23:17:12 +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
Jan Rodák
f49950c370 Merge pull request #28153 from timcoding1988/swagger-update
Swagger update:  Added missing documented params for already-supported api docs.
2026-03-02 16:40:18 +01:00
Jan Rodák
a11f22292e Merge pull request #28161 from ygalblum/quadlet-volume-mount-options
Quadlet Volume - allow setting mount option without a device
2026-03-02 16:37:35 +01:00
Ygal Blum
6c41f55aa7 Quadlet Volume - allow setting mount option without a device
Fixes: #28132

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2026-02-26 12:27:23 -05:00
Ygal Blum
64ec31ac00 Add nocreate option for named volumes
Add a per-volume 'nocreate' option that prevents automatic creation of
named volumes when they don't exist. When specified, Podman will fail
if the volume is not found instead of creating it automatically.

Usage: -v myvolume:/data:nocreate
       --mount type=volume,src=myvolume,dst=/data,nocreate

See: #27862
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2026-02-26 11:14:32 -05:00
Tim Zhou
e914c30dd5 update swagger changes
Signed-off-by: Tim Zhou <tizhou@redhat.com>
2026-02-26 09:51:15 -05:00
Jan Rodák
4e62f2429a Merge pull request #28138 from Luap99/golangci-lint
update golangci-lint to v2.10.1
2026-02-25 13:53:59 +01:00
Paul Holzinger
8a0c777017 fix new staticcheck warnings
As reported by golangci-lint v2.10.1.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-02-23 10:00:51 +01:00
Paul Holzinger
5e3719c81a fix two issues found by nilness
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-02-23 09:53:35 +01:00
Patrick Koenig
0d7f00b4c0 List all status values in status filter documentation
Signed-off-by: Patrick Koenig <pkoenig10@gmail.com>
2026-02-19 09:28:37 -05: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
Jan Rodák
38e1aa7ba0 Merge pull request #28085 from JCBird1012/main
compat/api: honor VolumeOptions.Subpath for HostConfig.Mounts
2026-02-18 10:48:54 +01:00
Paul Holzinger
f4aa01967e Merge pull request #28099 from Honny1/quadlets-restart-pod
Respect user-specified `Restart=` policy in pod units
2026-02-17 12:49:20 +01:00
Jan Rodák
33e8abd637 Respect user-specified Restart= policy in pod units
Fixes: https://github.com/containers/podman/issues/28081

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2026-02-16 22:12:18 +01:00
Paul Holzinger
a1afa58e27 system service: remove config reload functionallity
As I outlined in the design docs this is broken, there are several
data races here because we write to the config files that can be read by
other goroutines in parallel which violates the go memory model and
thus can lead to runtime panics and undefined behavior.
One could fix with a mutex but that would make the whole code base much
more ugly and there is still the risk that something would access this
field without the mutex held.

I am not sure we have any users using this, it never worked for the
storage side and since the service is a not a daemon any user could just
stop and start it again to re-read the files without having to stop
running containers.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2026-02-16 13:47:56 +01:00
Jonathan Caicedo
b584337bd6 compat/api: honor VolumeOptions.Subpath for HostConfig.Mounts
fixes: #27171
Signed-off-by: Jonathan Caicedo <jonathan@jcaicedo.com>
2026-02-13 12:47:54 -05:00
Paul Holzinger
88bd85367d Merge pull request #28008 from shiv-tyagi/vendor-detection
Discover GPU vendor from CDI spec before injecting GPU for --gpus option
2026-02-12 18:54:34 +01:00
Shiv Tyagi
d7a80dda1e Discover vendor from cdi spec before injecting CDI device for --gpu option
Signed-off-by: Shiv Tyagi <Shiv.Tyagi@amd.com>
2026-02-12 12:11:47 +00:00
Kir Kolyshkin
94442ae44e pkg/machine/e2e: simplify runWslCommand
runWslCommand never returns err != nil because if there's an error, it
calls Fail (which panics, so the code after it is unreachable).

Remove error returning and checking.

Inspired by the following linter warning:

> pkg/machine/e2e/config_windows_test.go:59:56: runWslCommand - result 1 (error) is always nil (unparam)
> func runWslCommand(cmdArgs []string) (*machineSession, error) {
>                                                        ^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:11 -08:00
Kir Kolyshkin
f9002cfd31 Fix GOOS=windows prealloc linter warnings
These ones:

> cmd/winpath/main.go:148:2: directive `//nolint:prealloc` is unused for linter "prealloc" (nolintlint)
> 	//nolint:prealloc
> 	^
> pkg/machine/hyperv/vsock/vsock.go:425:2: Consider preallocating allSocks (prealloc)
> 	allSocks := []*HVSockRegistryEntry{}
> 	^
> pkg/machine/wsl/machine.go:464:2: Consider preallocating newArgs with capacity 4 + len(arg) (prealloc)
> 	newArgs := []string{"-u", "root", "-d", dist}
> 	^
> pkg/machine/wsl/machine.go:471:2: Consider preallocating newArgs with capacity 4 + len(arg) (prealloc)
> 	newArgs := []string{"-u", "root", "-d", dist}
> 	^

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:11 -08:00
Kir Kolyshkin
2a99655120 machine: prepend LocalhostSSHArgs to args
Rather than append LocalhostSSHArgs to args, prepend it, assuming the
order doesn't matter here.

This fixes the following prealloc warning (without decreasing
readability):

> cmd/podman/machine/cp.go:130:2: Consider preallocating args (prealloc)
> 	args := []string{"-r", "-i", sshConfig.IdentityPath, "-P", strconv.Itoa(sshConfig.Port)}
> 	^

This commit is part of series fixing issues reported by prealloc linter
from golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:11 -08:00
Kir Kolyshkin
b046387979 Inline the initial slice into append
Instead of creating a slice and then appending to it, let's inline the
initial slice into append. This may or may not result in less slice
reallocations, but it is silencing the prealloc linter warnings.

This commit is part of series fixing issues reported by prealloc linter
from golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:10 -08:00
Kir Kolyshkin
38f6bf07cc pkg/emulation: remove slice copying
Copying the slice is not necessary here since registeredBinfmtMisc
always creates the slice from scratch.

This commit is part of series fixing issues reported by prealloc linter
from golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:10 -08:00
Kir Kolyshkin
030057aecd Preallocate a slice
When we already know the resulting slice size but still need/want to use
append, it makes sense to preallocate the slice by using make with the
capacity argument.

This commit is part of series fixing issues reported by prealloc linter
from golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:10 -08:00
Kir Kolyshkin
d316cbb362 Don't use append if not necessary
Calling append can lead to resizing the slice. In case we have all
elements beforehand, it is not necessary to call append in the first
place and this avoid resizing.

This is the first part of fixing issues reported by prealloc linter from
golangci-lint v2.8.0.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-02-11 11:41:10 -08:00
Šimon Brauner
9727a43f5a Added setting UID and GID for volumes in quadlet
Related: https://issues.redhat.com/browse/RHEL-145863

Signed-off-by: Šimon Brauner <sbrauner@redhat.com>
2026-02-11 18:16:30 +01:00
Matt Heon
d220d58f08 Merge pull request #27993 from danishprakash/podman-buildah-vendor
vendor: update c/buildah to latest main
2026-02-04 16:02:39 -05:00
Paul Holzinger
8fbda3fbef Merge pull request #27999 from baude/applytransports
add bootc transports to os-apply
2026-02-03 14:53:18 +01:00
Mayowa Fajobi
1bfd4cb95b Fix healthcheck argument with spaces split in Docker API (#27818)
Fixes: #26519

Signed-off-by: MayorFaj <mayorfaj@gmail.com>
2026-02-03 12:49:28 +01:00
Paul Holzinger
cadc74b796 Merge pull request #27995 from chkpnt/proxyenv
Write DefaultEnvironment proxy values to /etc/systemd/user.conf.d/default-env.conf
2026-02-03 12:48:21 +01:00
Mario Loriedo
6e053689d5 Merge pull request #27795 from MayorFaj/fix-env-envfrom-precedence-27287
fix: ensure environment variable precedence between env and envFrom
2026-02-03 11:31:59 +01:00
Danish Prakash
827ba37b3e build: handle --iidfile-raw and --metadata-file flags
* docs: man page additions
* test/e2e: add tests for `--iidfile-raw` and `--metadata-file`
* test/buildah-bud: update buildah-bud test patch for buildah v1.42.1

Signed-off-by: Danish Prakash <contact@danishpraka.sh>
2026-02-03 09:18:29 +05:30
Brent Baude
40b2a585f9 Autocomplete machine fixes
Fixups for autocomplete for machine commands.  This was authored by Paul
Holzinger.

Thank you very much!

Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-02-02 15:19:37 -06:00
Brent Baude
f4138d3599 add bootc transports to os-apply
now that we use `bootc switch` for changing out-of-band updates, we can
consider also using some of their supported transports.

* containers-storage
* oci
* oci-archive
* registry

RUN-3963
Signed-off-by: Brent Baude <bbaude@redhat.com>
2026-02-02 09:07:08 -06:00
Gregor Dschung
644bf2e04a Fix interfering escaping of commas and spaces in no_proxy variable
Signed-off-by: Gregor Dschung <gregor@chkpnt.de>
2026-02-02 15:49:25 +01:00
Gregor Dschung
a6167bdecc Write DefaultEnvironment proxy values to /etc/systemd/user.conf.d/default-env.conf
Otherwise, the proxy values aren't passed to rootless podman.

Signed-off-by: Gregor Dschung <gregor@chkpnt.de>
2026-02-02 15:49:05 +01:00
Gregor Dschung
e545f9ca61 Fix test proxyenv/env_test.go for systems that use proxy variables
Signed-off-by: Gregor Dschung <gregor@chkpnt.de>
2026-02-02 15:42:00 +01:00
Brent Baude
3d4f25e6d3 Merge pull request #27936 from inknos/get-exists-quadlet-api
Add GET /quadlets/{name}/exists
2026-01-28 10:58:46 -06:00
Brent Baude
b60d234da4 Merge pull request #27827 from lsm5/podman6-no-cni
Podman6: Remove CNI
2026-01-28 10:20:56 -06:00
Chawye Hsu
ce568f75dc chore(machine): remove unused EvalSymlinksOrClean function and tests
Related to https://github.com/containers/container-libs/pull/612

Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
2026-01-28 02:42:45 +08:00
Nicola Sella
eb0c4716d3 Add GET /quadlets/{name}/exists
Fixes: https://issues.redhat.com/browse/RUN-4068

Signed-off-by: Nicola Sella <nsella@redhat.com>
2026-01-27 16:10:56 +01:00
Lokesh Mandvekar
454167efa9 Remove CNI-specific code paths from libpod
Remove CNI-specific conditional logic and update comments throughout
the libpod networking code:

- Simplified DNS configuration logic in container_internal_common.go
  to always use netavark behavior (removed backend checks)
- Removed CNI-specific iptables chain error regex pattern
- Updated all comments referencing 'CNI' to use 'netavark' or
  'network backend'
- Renamed variable 'cniNet' to 'netInfo' for clarity
- Updated field and type documentation to remove CNI references

All networking code now assumes netavark as the sole backend.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-27 16:32:38 +05:30
Lokesh Mandvekar
f6bddc8af2 Remove CNI backend configuration from runtime
Remove runtime configuration options for CNI network backend:

Runtime options:
- Remove WithNetworkBackend() runtime option function
- Function allowed setting network backend programmatically

Flag handling:
- Remove --network-backend flag change detection
- Remove call to WithNetworkBackend() when flag changed
- Remove TODO comment about CNI plugins directory flag

The network backend configuration is now handled entirely by the
vendored common/libnetwork code, which will default to Netavark.
There is no longer any way to configure CNI as the network backend
through Podman's runtime initialization.

Note: libpod/info.go keeps existing NetworkBackend reporting logic
which will automatically report "netavark" as the only backend since
configuration defaults to netavark and cannot be changed to CNI.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-27 16:32:38 +05:30
Lokesh Mandvekar
73ef7cfcdc Remove CNI backend from CLI options and completions
Remove user-facing CLI options for CNI network backend:

CLI flags:
- Keep --network-backend global flag as hidden and deprecated for
  backward compatibility with cleanup commands from 5.x containers
- Map flag to a throwaway variable (value is ignored)
- Remove shell completion for network backend values

Shell completions:
- Remove AutocompleteNetworkBackend() function
- Remove references to CNI and Netavark type constants

Backward compatibility:
- Remove --rootless-cni flag alias for podman unshare
- Remove SetNormalizeFunc that mapped rootless-cni to rootless-netns
- Update --rootless-netns flag description to mention only netavark

The --network-backend flag remains as a hidden deprecated flag to
prevent failures when upgrading from 5.x where containers may have
cleanup commands that include this flag. The flag is accepted but
ignored. Users can no longer specify CNI as a network backend option.
The --rootless-cni alias is removed; users must use --rootless-netns.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2026-01-27 16:32:38 +05:30