Conversation
d40f601 to
618bbfe
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
cfd30ac to
ced6336
Compare
|
|
Honestly, I'm still a bit on the fence on this one, and not sure how much validation we can do on the client side (as "what's supported" may change on the daemon side, and even between API versions). To some extent considering if we should go the reverse; just parse the general format, and let the daemon return errors where things are invalid. |
|
I'm kinda neutral here - even if we'd change anything, that would still be gated by the API version which would require a newer CLI anyway. But on the other hand... We will have the error message even without it, so there's no real gain for the UX. |
|
@thaJeztah are we still considering this? |
|
I need to look at this one again; it's probably not urgent, so might be fine for later |
ced6336 to
1fb63eb
Compare
6006ff0 to
f1c3df1
Compare
- opts.ParseRestartPolicy: use a struct-literal and clarify that this function only parses, but does not validate invalid combinations. - cli/compose/convert: convertRestartPolicy: update doc to be more clear on the order of preference and intent. - cli/compose/convert: convertRestartPolicy: use a switch based on known values to allow the exhaustive linter to catch missing options. - cli/compose/convert: convertRestartPolicy: add validation for negative values when converting the legacy service.restart policy. - cli/compose/convert: convertRestartPolicy: always set MaxAttempts and leave validation to the daemon. opts: ParseRestartPolicy: improve validation of max restart-counts Use the new container.ValidateRestartPolicy utility to verify if a max-restart-count is allowed for the given restart-policy. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
f1c3df1 to
e4a49e1
Compare
|
OK; I went the reverse: make the parsing more agnostic, and leave validation to the daemon side, except for the "stack" (compose file) conversion, because for those we still need to map "container" restart policies to "swarm" restart policies. |
function only parses, but does not validate invalid combinations.
clear on the order of preference and intent.
known values to allow the exhaustive linter to catch missing options.
values when converting the legacy service.restart policy.
and leave validation to the daemon.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)