Repository navigation
Conversation
A service with deploy.restart_policy.condition set to on-failure was logged as unimplemented and the container was created with the default --restart=no, so it was never restarted after a failure, even though nerdctl run supports --restart=on-failure[:N]. Map the condition to --restart=on-failure, and to on-failure:N when max_attempts is set, matching what docker compose does. max_attempts is only meaningful with on-failure, so warn and ignore it for the other conditions. Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A compose service with
was logged as
deploy.restart_policy.condition="on-failure" (unimplemented)and the container was created with the default--restart=no, so it was never restarted after a failure.nerdctl runalready supports--restart=on-failure[:N], so there is nothing missing on the runtime side.This maps the condition to
--restart=on-failure, or--restart=on-failure:Nwhenmax_attemptsis set, which is what docker compose does.max_attemptsonly makes sense withon-failure, so for the other conditions it is ignored with a warning (as it was before, through the unknown-field warning).Testing: added
TestParseDeployRestartPolicyinpkg/composer/serviceparser. It fails on main (--restart=on-failureis not in the run args) and passes with this change; the rest of the package tests pass too.AI disclosure: written with the help of Claude Code, reviewed and tested by me.