mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #18788 from ygalblum/quadlet-pull
Quadlet - add support for Pull key in .container
This commit is contained in:
@ -121,6 +121,7 @@ Valid options for `[Container]` are listed below:
|
||||
| Notify=true | --sdnotify container |
|
||||
| PodmanArgs=--add-host foobar | --add-host foobar |
|
||||
| PublishPort=true | --publish |
|
||||
| Pull=never | --pull=never |
|
||||
| ReadOnly=true | --read-only |
|
||||
| RunInit=true | --init |
|
||||
| SeccompProfile=/tmp/s.json | --security-opt seccomp=/tmp/s.json |
|
||||
@ -283,8 +284,7 @@ Equivalent to the Podman `--hostname` option.
|
||||
|
||||
### `Image=`
|
||||
|
||||
The image to run in the container. This image must be locally installed for the service to work
|
||||
when it is activated, because the generated service file never tries to download images.
|
||||
The image to run in the container.
|
||||
It is recommended to use a fully qualified image name rather than a short name, both for
|
||||
performance and robustness reasons.
|
||||
|
||||
@ -391,6 +391,11 @@ allocated port can be found with the `podman port` command.
|
||||
|
||||
This key can be listed multiple times.
|
||||
|
||||
### `Pull=`
|
||||
|
||||
Set the image pull policy.
|
||||
This is equivalent to the Podman `--pull` option
|
||||
|
||||
### `ReadOnly=` (defaults to `no`)
|
||||
|
||||
If enabled, makes image read-only, with /var/tmp, /tmp and /run a tmpfs (unless disabled by `VolatileTmp=no`).r
|
||||
|
@ -81,6 +81,7 @@ const (
|
||||
KeyOptions = "Options"
|
||||
KeyPodmanArgs = "PodmanArgs"
|
||||
KeyPublishPort = "PublishPort"
|
||||
KeyPull = "Pull"
|
||||
KeyReadOnly = "ReadOnly"
|
||||
KeyRemapGID = "RemapGid"
|
||||
KeyRemapUID = "RemapUid"
|
||||
@ -143,6 +144,7 @@ var (
|
||||
KeyNotify: true,
|
||||
KeyPodmanArgs: true,
|
||||
KeyPublishPort: true,
|
||||
KeyPull: true,
|
||||
KeyReadOnly: true,
|
||||
KeyRemapGID: true,
|
||||
KeyRemapUID: true,
|
||||
@ -625,6 +627,11 @@ func ConvertContainer(container *parser.UnitFile, isUser bool) (*parser.UnitFile
|
||||
podman.add("--hostname", hostname)
|
||||
}
|
||||
|
||||
pull, ok := container.Lookup(ContainerGroup, KeyPull)
|
||||
if ok && len(pull) > 0 {
|
||||
podman.add("--pull", pull)
|
||||
}
|
||||
|
||||
handlePodmanArgs(container, ContainerGroup, podman)
|
||||
|
||||
if len(image) > 0 {
|
||||
|
6
test/e2e/quadlet/pull.container
Normal file
6
test/e2e/quadlet/pull.container
Normal file
@ -0,0 +1,6 @@
|
||||
## assert-podman-final-args localhost/imagename
|
||||
## assert-podman-args --pull never
|
||||
|
||||
[Container]
|
||||
Image=localhost/imagename
|
||||
Pull=never
|
@ -578,6 +578,7 @@ var _ = Describe("quadlet system generator", func() {
|
||||
Entry("mount.container", "mount.container"),
|
||||
Entry("health.container", "health.container"),
|
||||
Entry("hostname.container", "hostname.container"),
|
||||
Entry("pull.container", "pull.container"),
|
||||
|
||||
Entry("basic.volume", "basic.volume"),
|
||||
Entry("label.volume", "label.volume"),
|
||||
|
Reference in New Issue
Block a user