Skip to content

feat(compose): support restart policy conditions and delays - #239

Open
x3ccd4828 wants to merge 2 commits into
containers:mainfrom
x3ccd4828:feat/compose-restart-delay
Open

x3ccd4828 wants to merge 2 commits into
containers:mainfrom
x3ccd4828:feat/compose-restart-delay

Conversation

@x3ccd4828

@x3ccd4828 x3ccd4828 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Compose configurations that request a fixed restart delay currently fail with deploy is not supported, requiring a separate systemd override alongside generated Quadlets.

Convert deploy.restart_policy.condition and delay into [Service] Restart= and RestartSec=. The deployment policy takes precedence over the service-level restart field, with Compose defaults of condition: any and delay: 0s. Existing restart conversion stays unchanged when no deployment policy is present. Both standalone and --pod Quadlet output use the conversion.

Also expose --restart-sec DURATION for Podman command conversion. Keep unsupported max_attempts, window, extensions, and other deployment settings as errors so they are not silently ignored.

For example:

services:
  app:
    image: quay.io/podman/hello
    deploy:
      restart_policy:
        condition: any
        delay: 5s

now includes:

[Service]
Restart=always
RestartSec=5s

CI compatibility: Rust 1.99.1 reports trailing-semicolon macro errors for three existing bail! match arms. A separate follow-up commit places those calls in statement blocks without changing their behavior.

Validation:

  • cargo +1.99.1 fmt --check
  • cargo +1.99.1 test --locked — 87 passed
  • cargo +1.99.1 clippy --locked -- -D warnings
  • cargo build --locked
  • Generated standalone and pod Quadlets with the built CLI and verified Restart=always and RestartSec=5s in the installed Quadlet generator's output.
  • Tested defaults, precedence, zero/subsecond/compound durations, legacy restart policies, CLI output, and rejection of unsupported settings.

Signed-off-by: Cristian Filipescu <filipescu.cristian@gmail.com>
Signed-off-by: Cristian Filipescu <filipescu.cristian@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant