Commit Graph

4339 Commits

Author SHA1 Message Date
openshift-merge-bot[bot]
516feff8ec Merge pull request #27568 from grey3228/fix/avoid_potential_nil_deref_in_img_rm
avoid potential nil ptr deref in image rm
2025-11-20 23:10:11 +00:00
Mikhail Dmitrichenko
8411881ab2 avoid potential nil ptr deref in image rm
In function rm variable `report` might be initialized as nil as a result
of call
`registry.ImageEngine().Remove(registry.Context(), args, imageOpts)`.
Then, there is a call `registry.SetExitCode(report.ExitCode)` without
explicit nil check before. Check `len(rmErrors) > 0` doesn't guarantee
that report is a non-nil value.
So such call may lead to nil deref.

This commit adds check `report` for nil before its dereference.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com>
2025-11-20 17:22:18 +03:00
ryanmccann1024
61cbc0c3ee feat(exec): Add --no-session flag for improved performance
Fixes: #26588

For use cases like HPC, where `podman exec` is called in rapid succession, the standard exec process can become a bottleneck due to container locking and database I/O for session tracking.

This commit introduces a new `--no-session` flag to `podman exec`. When used, this flag invokes a new, lightweight backend implementation that:

- Skips container locking, reducing lock contention
- Bypasses the creation, tracking, and removal of exec sessions in the database
- Executes the command directly and retrieves the exit code without persisting session state
- Maintains consistency with regular exec for container lookup, TTY handling, and environment setup
- Shares implementation with health check execution to avoid code duplication

The implementation addresses all performance bottlenecks while preserving compatibility with existing exec functionality including --latest flag support and proper exit code handling.

Changes include:
- Add --no-session flag to cmd/podman/containers/exec.go
- Implement lightweight execution path in libpod/container_exec.go
- Ensure consistent container validation and environment setup
- Add comprehensive exit code testing including signal handling (exit 137)
- Optimize configuration to skip unnecessary exit command setup

Signed-off-by: Ryan McCann <ryan_mccann@student.uml.edu>
Signed-off-by: ryanmccann1024 <ryan_mccann@student.uml.edu>
2025-11-19 12:44:48 -05:00
openshift-merge-bot[bot]
af91cae1c5 Merge pull request #27271 from lsm5/podman6-no-cgv1
Podman6: Remove cgroupsv1
2025-11-14 17:03:59 +00:00
Lokesh Mandvekar
6f43a66629 cmd/podman/system/service_abi_linux.go: Remove Cgroups v1
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:34 -05:00
Lokesh Mandvekar
f2c9fcd68f cmd/podman/containers/unpause: Remove cgroupv1 check
This didn't error check for mounted cgroups, only errored for rootless
cgroupsv1 containers. Safe to remove.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:32 -05:00
Lokesh Mandvekar
e860773c0d cmd/podman.persistentRunE(): Fatal linux check if no Cgroups v2
Will log and proceed on non-linux env.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
2025-11-12 15:15:32 -05:00
Brent Baude
57052a8cc7 Fix regression in podman machine ssh
While doing the provider obfuscation, I injected a regression where
podman ssh machine failed.  The regression was added in
0f22c1c772.  I have fixed the regression
and added a test to prevent future occurance.

Fixes: #27491

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-11-12 10:37:48 -06: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
openshift-merge-bot[bot]
80840578be Merge pull request #27395 from nalind/grpc-noop
Parse grpc requests on the service socket
2025-11-10 13:45:27 +00:00
openshift-merge-bot[bot]
17beac160c Merge pull request #27405 from baude/setdefaultconnection
Add `update-connection` to machine start and init
2025-11-04 20:03:58 +00:00
Brent Baude
b4ec460ed4 Add update-connection to machine start and init
This allows users to set the associated machine's system connection to the system default when running `podman machine init --now` or `podman machine start`.  It also changes the default bbehavior of these commands in that the user will be prompted and asked if they would like to switch the system connection.  It also introduces a command line switch called `--update-connection`.  If the switch is unset, then the user will be prmpted.  If the command value is explicitly set to `false`, the user will not be prompted and the system connection will not be altered.  If the value is set to `true`, the system connection will be made the default and the user will not be prompted.

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

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-11-04 10:35:28 -06:00
openshift-merge-bot[bot]
eb63a1f38d Merge pull request #27005 from zifeitong/newer
Fix podman build "newer" pull policy
2025-11-04 15:17:37 +00:00
Nalin Dahyabhai
be82989be3 Add a no-op GRPC responder service to the podman system service
Add a bare minimum GRPC service to the podman system service socket.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2025-11-03 11:14:32 -05:00
Brent Baude
553c4a16d5 Fix use of duplicate machine names
A condition was changed in the refgactor of init where duplicate names would be allowed but no machine was created.  Duplicate names are not permitted and should return an error.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-10-30 07:50:08 -05:00
Brent Baude
5e1c2f8d7d Machine init --provider
Add the ability for users to override the default provider when creating mahcines.  The new flag is `--provider` and allows you to specifiy a valid vmtype for the platform.  This PR also removes the previous list test where we tested listing all providers.  I added a PR for testing --provider which includes a standard `machine ls` which defaults now to showing all providers.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-10-29 07:59:34 -05:00
openshift-merge-bot[bot]
01b669346e Merge pull request #27387 from mheon/remove_boltdb
Remove BoltDB state support
2025-10-28 17:41:05 +00:00
Matt Heon
f5bc2abe4c Remove BoltDB state support
This also includes a number of significant changes to the SQLite
state made possible by removal of the legacy DB.

1. Enable database unit tests for SQLite state, with numerous
   tweaks to get tests passing. Most notable changes are to
   container removal - where we previously didn't return an error
   if there was no container to remove - and RemovePodContainers,
   which I don't think ever worked properly from my reading of
   the failures.
2. Removal of AddContainerToPod/RemoveContainerToPod. On SQLite,
   these functions are identical to AddContainer/RemoveContainer
   and there is no reason to retain duplicates.
3. Removal of SafeRewriteContainerConfig - it's identical to
   RewriteContainerConfig in SQLite, no reason to have duplicate
   entrypoints.

As an exciting side-note, this removes Podman's requirement that
containers and pods cannot share a name, which was a BoltDB
restriction only.

Signed-off-by: Matt Heon <matthew.heon@pm.me>
2025-10-28 12:09:04 -04:00
Brent Baude
0f22c1c772 Provider obfuscation in command line
For Podman 6, we still have providers and will continue to have a default provider for each platform.  But where a platform has multiple providers, we want users to be able to cross provider boudnaries imposed in Podman 4/5.  The key change is to look up virtual machines by name, as before, but to then also iterate all possible providers.  As of this PR, init will still only create with the default provider, but a subsequent PR will introdouce an provider override.

I also removed the "--all-providers" command line option on `podman
machine ls` because it no longer makes sense. And I marked the all
provider list test to be skipped.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2025-10-27 08:40:19 -05:00
openshift-merge-bot[bot]
5a0b74b13e Merge pull request #27352 from rhatdan/artifact
Add CreatedAt format option to podman artifact ls
2025-10-24 19:09:56 +00:00
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
Daniel J Walsh
96ab027a3c Add CreatedAt format option to podman artifact ls
This change adds a .CreatedAt format option to the podman artifact ls
command to match the behavior of podman images --format CreatedAt.

The .Created field continues to display human-readable elapsed time
(e.g., '6 hours ago'), while the new .CreatedAt field displays the
full timestamp (e.g., '2025-10-23 12:34:56 +0000 UTC').

Changes:
- Refactored artifactListOutput struct to store time.Time value
- Added CreatedAt() method returning full timestamp string
- Added Created() method for human-readable duration
- Updated documentation to include .CreatedAt field
- Added e2e test for .CreatedAt format option

Generated-with: Cursor AI
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2025-10-23 09:35:21 -04:00
Artem Sierikov
61291e8c70 quadlet: add cat alias for print
Add new alias `podman quadlet cat` to `podman quadlet print`
to align Podman's quadlet CLI with systemd conventions.

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

Signed-off-by: Artem Sierikov <sierikov@pm.me>
2025-10-22 20:05:08 +02:00
openshift-merge-bot[bot]
4a2e52f4ed Merge pull request #27182 from skyraider256526/main
feat: add `--format` flag to artifact inspect
2025-10-22 13:22:09 +00:00
openshift-merge-bot[bot]
c15e84534e Merge pull request #27292 from Honny1/pr-multi-file-support-kube
Add multi-file support to `podman kube play/down`
2025-10-22 11:46:42 +00:00
Paul Holzinger
339a432dd9 fix artifact inspect issues
Fix remaining CI issues from PR #27182.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-10-22 13:04:13 +02:00
axel7083
9bda788edf feat(cmd): podman kube play support multiple arguments
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>

fix: update kube play command cobra use

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>

Add multi-file support to podman kube play/down

- Support multiple YAML files and URLs in single command
- Combine files with YAML document separators (---)
- Refactor for better testability with dependency injection
- Update documentation with examples for multiple inputs
- Improve memory efficiency with streaming I/O operations

Fixes: https://github.com/containers/podman/issues/26274
Fixes: https://issues.redhat.com/browse/RUN-3586

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-10-22 12:10:46 +02:00
Celso Henrique Souza Silva
0ea4eaee70 cmd/podman: add replace flag to quadlet install
Signed-off-by: Celso Henrique Souza Silva <celsohenrique367@gmail.com>
Fixes: #26930
2025-10-21 14:03:23 -03:00
openshift-merge-bot[bot]
935e82544a Merge pull request #27319 from NotSoFancyName/artifact-ls-created
artifact: added CREATED column to artifact ls
2025-10-21 15:07:26 +00:00
Akash Yadav
1fbf24b65b feat: add --format flag to artifact inspect
Many commands support the `--format` flag which accept a go template to
allow for formatting for certain values, but it is not
yet implemented for artifact inspect command.

Adding this feature will allow easy formatting in scripts as well as
running it on a terminal.

This feature is implemented for artifact inspect by taking reference
from images and network commands implementation.

Fixes: [#27112](https://github.com/containers/podman/issues/27112)

Signed-off-by: Akash Yadav <akashyadav256526@gmail.com>
2025-10-21 16:58:03 +05:30
openshift-merge-bot[bot]
b3ec5cf29e Merge pull request #26618 from mtrmac/sequoia
Add --sign-by-sq-fingerprint
2025-10-21 11:06:38 +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
openshift-merge-bot[bot]
1a8eb18b2b Merge pull request #27310 from mheon/default-runtime-flags
Add support for runtime flags in containers.conf
2025-10-20 10:57:46 +00:00
Volodymyr Pankin
538229da90 artifact: added CREATED column to artifact ls
Fixes: #27314

Signed-off-by: Volodymyr Pankin <volopank@gmail.com>
2025-10-19 20:22:55 +02: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
Rosvaldas Atstupėnas
0a20e22384 Add default runtime flags in config
Added a way to define default runtime flags in config.

Fixes: https://github.com/containers/common/issues/715

Default runtime flags should be defined as shown below:

[engine.runtimes_flags]
runsc = [
  "net-raw",
]

crun = [
  "debug",
]

Signed-off-by: Rosvaldas Atstupėnas <atstupenas.rosvaldas@gmail.com>
2025-10-16 13:51:46 -04:00
goldlinker
b394fe1a87 chore: remove repetitive word in cmd/podman/README.md
Signed-off-by: goldlinker <goldlinker@outlook.jp>
2025-10-16 15:25:34 +08:00
Oleksandr Krutko
098d8efecc add option to remove Pod name prefix in resulting container name
Signed-off-by: Oleksandr Krutko <alexander.krutko@gmail.com>
2025-10-15 23:37:03 +03:00
openshift-merge-bot[bot]
32d6c54054 Merge pull request #26624 from Odilhao/artifact-quadlet-implementation
Add artifact quadlet unit type support
2025-10-13 14:41:25 +00:00
Odilon Sousa
34254cd1d0 Add artifact quadlet unit type support
RFE: Add artifact quadlet unit type #25778

Signed-off-by: Odilon Sousa <osousa@redhat.com>
2025-10-10 11:08:33 -03:00
Jan Rodák
6d63d165ef Fix flaky sysctl completion by handling /proc/sys errors gracefully
Skip directories on any error during /proc/sys traversal (race conditions,
permission denied, etc.) to provide partial completion results rather than
failing completely. Use filepath.WalkDir for better performance.

Fixes: #27252

Signed-off-by: Jan Rodák <hony.com@seznam.cz>
2025-10-10 10:53:36 +02:00
openshift-merge-bot[bot]
2455ac327d Merge pull request #27153 from rhatdan/cursor
Add --replace option to podman artifact add command
2025-10-07 17:09:03 +00:00
Jan Rodák
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
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
Jan Rodák
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
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
openshift-merge-bot[bot]
77dd165e47 Merge pull request #27193 from shiavm006/fix-secret-ls-format-docs
secrets: align 'secret ls' format docs and completion
2025-10-02 19:40:20 +00:00