Allow 0 restart delay#781
Conversation
Current coverage is 55.11%
@@ master #781 diff @@
==========================================
Files 82 81 -1
Lines 11893 11724 -169
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 6321 6461 +140
+ Misses 4720 4397 -323
- Partials 852 866 +14
|
|
What's wrong with using a negative value to disable restart delay? I am not sure it is a good idea to introduce another level of objects. |
|
@stevvooe: My main concern with doing this is that the client would have to explicitly translate user input of 0 to a negative value. If we forget to do this in some case, we'll get the wrong behavior. It's also counterintuitive to someone working with the API that specifying |
eecf9da to
df79f4d
Compare
|
New plan: let's use the I'll update the PR. |
df79f4d to
a6668e4
Compare
|
Updated PTAL |
95fe98e to
d0e8a60
Compare
There was a problem hiding this comment.
Fixed, thanks.
d0e8a60 to
2bedd31
Compare
|
LGTM |
This makes Restart.Delay and Restart.Window nullable by using the Duration message type. Then the client can omit these fields to use the default values. If 0 is explicitly specified, 0 is used, not the default. For consistency, switch all other time.Duration values in the protobufs to use the Duration message type. This also fixes an inconsistency introduced when the orchestrator was changed to apply a default restart delay rather than doing this purely client-side. The default wasn't being applied when handling tasks at orchestrator startup. Fixes #721 Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2bedd31 to
1387084
Compare
|
LGTM |
This makes Restart.Delay and Restart.Window nullable by using the
Duration message type. Then the client can omit these fields to use the
default values. If 0 is explicitly specified, 0 is used, not the
default.
For consistency, switch all other time.Duration values in the protobufs
to use the Duration message type.
This also fixes an inconsistency introduced when the orchestrator was
changed to apply a default restart delay rather than doing this purely
client-side. The default wasn't being applied when handling tasks at
orchestrator startup.
Fixes #721
cc @aluzzardi