Commit Graph

357 Commits

Author SHA1 Message Date
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
givensuman
e7b50c33df Add AppArmor key to quadlet .container files
Fixes: #27095
Signed-off-by: givensuman <givensuman@duck.com>
2025-11-05 18:15:52 -05:00
Dmitry Konishchev
601a072b51 Escape RequiresMountsFor value
Signed-off-by: Dmitry Konishchev <konishchev@gmail.com>
2025-10-27 20:01:45 +03: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
axel7083
8e013c0012 feat(quadlet: kube): support multiple Yaml entries
fixes https://github.com/containers/podman/issues/26274

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2025-10-22 16:09:47 +02:00
openshift-merge-bot[bot]
f2a559a8fe Merge pull request #27309 from ygalblum/quadlet-build-ignorefile
Quadlet build - add support for IgnoreFile key
2025-10-17 15:37:32 +00: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
Ygal Blum
1800b34b51 Quadlet build - add support for IgnoreFile key
Resolves: https://github.com/containers/podman/issues/27268

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-10-16 14:02:04 -04:00
openshift-merge-bot[bot]
ba4d836044 Merge pull request #27256 from givensuman/T-27065-add-quadlet-build-args-support
Add BuildArg key to quadlets
2025-10-16 15:24:52 +00: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
givensuman
720e263767 Add BuildArg key to quadlets
Signed-off-by: givensuman <givensuman@duck.com>
2025-10-08 12:44:11 -04:00
ByoungUk Lee
d1c43e3ae8 Fixed #27120: Pod Quadlet can configure podman pod stop --time
Signed-off-by: ByoungUk Lee <nimdrak@gmail.com>
2025-10-08 23:53:14 +09: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
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]
ef584d4d6d Merge pull request #27169 from ygalblum/quadlet-template-dependency
Quadlet - Support template dependency
2025-10-03 15:51:31 +00:00
Matt Souza
090304a054 lint: reenable revive unused-parameter check
Signed-off-by: Matt Souza <medsouz99@gmail.com>
2025-10-01 10:42:08 -04:00
Ygal Blum
83e65f91a4 Quadlet - Support template dependency
Add support for Volumes and Networks
Add e2e and system tests

Resolves: https://github.com/containers/podman/issues/25136

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-09-30 13:41:20 -04:00
Paul Holzinger
9e4fad8d06 pkg/systemd/quadletL silence one lint warning
t.Chdir() is not an exact replacement here

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-10 16:17:05 +02:00
Paul Holzinger
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
Paul Holzinger
b97525a78d use strings.SplitSeq where possible
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-10 16:17:04 +02:00
Ygal Blum
936a01e088 Quadlet build - consider File path that starts with a systemd specifier as absolute
Fixes https://github.com/containers/podman/issues/26746

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-09-09 13:57:36 -04:00
openshift-merge-bot[bot]
8900d8e77b Merge pull request #26984 from Luap99/pflag
update module github.com/spf13/pflag to v1.0.10
2025-09-09 11:27:39 +00:00
Jakob Meier
163bdf2df8 quadlet: fix runtime error for invalid Mount value
If the `Mount` option inside a quadlet is missing the source=... part,
the code today panics with the following message.

```
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/containers/podman/v5/pkg/systemd/quadlet.handleStorageSource(0xc000140de0?, 0x1d?, {0x0?, 0x1?}, 0x5634e39e233e?, 0x10?)
...
```

This commit checks for the missing source and returns an error to avoid the panic.

Signed-off-by: Jakob Meier <mail@jakobmeier.ch>
2025-09-04 21:46:01 +02:00
Paul Holzinger
c2506656c4 spf13/pflag: replace deprecated ParseErrorsWhitelist
Use ParseErrorsAllowlist instead, should still work the exact same.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-09-04 14:04:47 +02:00
openshift-merge-bot[bot]
428c854be6 Merge pull request #26932 from ogajduse/feature/quadlet-httpproxy-26925
quadlet: add HttpProxy option for Container sections
2025-09-01 16:04:15 +00:00
Ondřej Gajdušek
c65fd9a2c2 quadlet: add HttpProxy option for Container sections
Add support for HttpProxy key in quadlet Container sections to control
proxy environment variable inheritance during image pulls and builds.

- HttpProxy=true enables proxy inheritance (default podman behavior)
- HttpProxy=false disables proxy inheritance
- When omitted, uses podman's default behavior

This addresses the need for declarative proxy configuration in IPv6-only
networks and other scenarios where proxy settings need to be controlled
at the container level without manual workarounds.

Fixes #26925

Signed-off-by: Ondřej Gajdušek <ogajduse@redhat.com>
2025-09-01 13:45:06 +02:00
Jan Kaluza
a98154a978 Switch common, storage and image to monorepo.
Signed-off-by: Jan Kaluza <jkaluza@redhat.com>
2025-09-01 12:33:04 +02:00
Matt Heon
f293c1a179 Initial implementation of podman quadlet commands
This adds `podman quadlet list`, `podman quadlet install`,
`podman quadlet rm` and `podman quadlet print`.

Signed-off-by: Matt Heon <mheon@redhat.com>
Co-authored-by: flouthoc <flouthoc.git@gmail.com>
Signed-off-by: flouthoc <flouthoc.git@gmail.com>
2025-07-18 13:57:11 -07:00
Ygal Blum
439448c287 Quadlet - add support for the Policy key for .image files
Resolves: #26446

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-07-10 13:06:38 -04:00
Ygal Blum
cd807f8ff6 Quadlet - print warning when fail to parse
Fixes: #26542

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-07-07 14:49:32 -04:00
Evan Miller
31b4efcaec warn instead of error, lift logic to main.go
Signed-off-by: Evan Miller <miller.evan815@gmail.com>
2025-07-02 18:23:00 -07:00
Evan Miller
4b1f7bcb9a Quadlet - Error when units define User, Group, or DynamicUser in Service group
Fixes: #26543

Signed-off-by: Evan Miller <miller.evan815@gmail.com>
2025-07-02 00:34:46 -07:00
openshift-merge-bot[bot]
72393c1c53 Merge pull request #26522 from ygalblum/quadlet-pod-service-environment
Quadlet - Do not override existing Environment in Service group for Pod units
2025-07-01 19:25:06 +00:00
openshift-merge-bot[bot]
43b74b1754 Merge pull request #26322 from NotSoFancyName/issue-26247
quadlet: handle generate environment params that inherit from host
2025-06-30 11:44:33 +00:00
Ygal Blum
f1a1948b23 Quadlet - Do not override existing Environment in Service group for Pod units
Fixes: #26521

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-06-27 09:56:43 -04:00
openshift-merge-bot[bot]
7808625785 Merge pull request #26472 from Luap99/quadlet-nologrus
quadlet: remove indirect logrus import
2025-06-19 19:45:24 +00:00
Paul Holzinger
964069326d quadlet: remove indirect logrus import
Reduces quadlet binary size about 170kb.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-19 18:47:40 +02:00
nbspsemicolon
5989370c39 pkg/systemd: expose [Pod] ExitPolicy key for pod create --exit-policy
Add ExitPolicy key to pod quadlets with logic to default to stop.

Docs updated with clarifcation on default value and usage example.

Simple assert added to bats to verify default constraint exists.

Changed argument order in ginkgo basic pod unit test

Signed-off-by: Neil Bailey <nbsp@nbailey.net>
2025-06-18 15:08:31 -04:00
Volodymyr Pankin
2b6c477884 quadlet: handle generate environment params that inherit from host
Fixes: #26247

Signed-off-by: Volodymyr Pankin <volopank@gmail.com>
2025-06-10 20:50:13 +02:00
Hiếu Lê
18ecd2046b quadlet: generate RequiresMountsFor for Type=bind volumes
This makes sure that the volume source is available before the volume is
created.

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

Signed-off-by: Hiếu Lê <leorize+oss@disroot.org>
2025-06-05 18:22:28 -05:00
Paul Holzinger
a0f7db44e8 quadlet: add InterfaceName option to network unit
I noticed this was missing, its a simple 1 to 1 mapping to
--interface-name.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-06-04 16:46:39 +02:00
Ygal Blum
09d9d3e26b Revert "Quadlet - fix pod name to depend on the name of the generate service"
This reverts commit 4f38c2fea2.

Fixes: #26105
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-05-12 09:33:16 -04:00
Ygal Blum
4f38c2fea2 Quadlet - fix pod name to depend on the name of the generate service
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-05-06 12:02:01 -04:00
openshift-merge-bot[bot]
400a9a528b Merge pull request #25722 from l0rd/fix-hyperv-volumes-with-space
Fix machines failing to start when a volume's path contains spaces
2025-05-02 14:03:15 +00:00
Ygal Blum
9b2fb40ab8 Quadlet - remove the usage of cid and podid for container and pod files
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-04-30 07:59:15 -04:00
Mario Loriedo
8e6ecb97c9 Fix running machines with volumes containing spaces
Machines configured to mount local paths containing
spaces failed to start on Hyper-V and silently failed
to mount the folder on macOS/Linux.

On Windows/hyperv, where local paths are mounted
running a 9p client inside the VM, the local host
path needs to be surrounding with quotation marks
before using in a `podman machine ssh ...` command.

A similar behavior happened on Linux/QEMU where the
path was used in a SSH command to mount the folder
using virtiofs. Quoting the path when buidling the
command arguments fixed the problem.

On macOS/libkit,applehv the path was written as is
in a systemd unit name to instruct how to mount it.
Escaping space chars so that they are are parsed
successfully fixed this:
```diff
-- enable path with spaces.mount
++ enable path\x20with\x20spaces.mount
```

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

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
2025-04-30 08:54:42 +02:00
Ygal Blum
3f56de0199 Quadlet - use helper function to initialize service struct
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-04-28 12:54:56 -04:00
Ygal Blum
633f727f2d Quadlet - use helper function for handling key=val type keys
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2025-04-24 14:15:39 -04:00
Robin Heinemeier
802fc15b1e Add Label to quadlet pod
Signed-off-by: Robin Heinemeier <sunnerlp@gmail.com>
2025-04-24 13:37:42 +00:00