Quadlet - add support for the Policy key for .image files

Resolves: #26446

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
Ygal Blum 2025-07-10 12:18:26 -04:00
parent cc84e29ddd
commit 439448c287
4 changed files with 17 additions and 0 deletions

View File

@ -1948,6 +1948,7 @@ Valid options for `[Image]` are listed below:
| ImageTag=quay\.io/centos/centos:latest | Use this name when resolving `.image` references |
| OS=windows | --os=windows |
| PodmanArgs=--os=linux | --os=linux |
| Policy=always | --policy=always |
| Retry=5 | --retry=5 |
| RetryDelay=10s | --retry-delay=10s |
| TLSVerify=false | --tls-verify=false |
@ -2048,6 +2049,12 @@ escaped to allow inclusion of whitespace and other control characters.
This key can be listed multiple times.
### `Policy=`
The pull policy to use when pulling the image.
This is equivalent to the Podman `--policy` option.
### `Retry=`
Number of times to retry the image pull when a HTTP error occurs. Equivalent to the Podman `--retry` option.

View File

@ -137,6 +137,7 @@ const (
KeyPod = "Pod"
KeyPodmanArgs = "PodmanArgs"
KeyPodName = "PodName"
KeyPolicy = "Policy"
KeyPublishPort = "PublishPort"
KeyPull = "Pull"
KeyReadOnly = "ReadOnly"
@ -427,6 +428,7 @@ var (
KeyImageTag: true,
KeyOS: true,
KeyPodmanArgs: true,
KeyPolicy: true,
KeyRetry: true,
KeyRetryDelay: true,
KeyServiceName: true,
@ -1312,6 +1314,7 @@ func ConvertImage(image *parser.UnitFile, unitsInfoMap map[string]*UnitInfo, isU
KeyCreds: "--creds",
KeyDecryptionKey: "--decryption-key",
KeyOS: "--os",
KeyPolicy: "--policy",
KeyVariant: "--variant",
KeyRetry: "--retry",
KeyRetryDelay: "--retry-delay",

View File

@ -0,0 +1,6 @@
## assert-podman-final-args localhost/imagename
## assert-podman-args "--policy" "always"
[Image]
Image=localhost/imagename
Policy=always

View File

@ -1027,6 +1027,7 @@ BOGUS=foo
Entry("Image - Credentials", "creds.image"),
Entry("Image - Decryption Key", "decrypt.image"),
Entry("Image - OS Key", "os.image"),
Entry("Image - Policy Key", "policy.image"),
Entry("Image - Variant Key", "variant.image"),
Entry("Image - All Tags", "all-tags.image"),
Entry("Image - TLS Verify", "tls-verify.image"),