mirror of
https://github.com/containers/podman.git
synced 2025-12-08 06:39:05 +08:00
If a container unit starts on boot with a dependency on `default.target` the image unit may start too soon, before network is ready. This cause the unit to fail to pull the image. - Add a dependency on `network-online.target` to make sure image pulls don't fail. See https://github.com/containers/podman/issues/21873 - Document the hardcoded dependency on `network-online.target` for images unit and explain how it can be overriden if necessary. - tests/e2e/quadlet: Add `assert-last-key-regex` Required to test the `After=` override in [Unit] section See https://github.com/containers/podman/pull/22057#issuecomment-2008959993 - quadlet/unitfile: add a prepenUnitLine method Requirements on networks should be inserted at the top of the section so the user can override them. Signed-off-by: jbtrystram <jbtrystram@redhat.com>
23 lines
1000 B
Plaintext
23 lines
1000 B
Plaintext
## assert-podman-final-args localhost/imagename
|
|
## assert-podman-args "--name=systemd-%N"
|
|
## assert-podman-args "--cidfile=%t/%N.cid"
|
|
## assert-podman-args "--rm"
|
|
## assert-podman-args "--replace"
|
|
## assert-podman-args "-d"
|
|
## assert-podman-args "--cgroups=split"
|
|
## assert-podman-args "--sdnotify=conmon"
|
|
## assert-key-is "Unit" "RequiresMountsFor" "%t/containers"
|
|
## assert-key-is "Service" "KillMode" "mixed"
|
|
## assert-key-is "Service" "Delegate" "yes"
|
|
## assert-key-is "Service" "Type" "notify"
|
|
## assert-key-is "Service" "NotifyAccess" "all"
|
|
## assert-key-is "Service" "SyslogIdentifier" "%N"
|
|
## assert-key-is-regex "Service" "ExecStopPost" "-[/S].*/podman rm -v -f -i --cidfile=%t/%N.cid"
|
|
## assert-key-is-regex "Service" "ExecStop" ".*/podman rm -v -f -i --cidfile=%t/%N.cid"
|
|
## assert-key-is "Service" "Environment" "PODMAN_SYSTEMD_UNIT=%n"
|
|
## assert-key-is "Unit" "After" "network-online.target"
|
|
## assert-key-is "Unit" "Wants" "network-online.target"
|
|
|
|
[Container]
|
|
Image=localhost/imagename
|