From 406c6348b62fd709cedea3d9878fb23db4e6f1ad Mon Sep 17 00:00:00 2001 From: allencloud Date: Tue, 17 Jan 2017 15:55:45 +0800 Subject: [PATCH] validate healthcheck params in daemon side Signed-off-by: allencloud --- command/container/opts.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/command/container/opts.go b/command/container/opts.go index 55cc3c3b29..245d8e856d 100644 --- a/command/container/opts.go +++ b/command/container/opts.go @@ -511,6 +511,9 @@ func parse(flags *pflag.FlagSet, copts *containerOptions) (*container.Config, *c if copts.healthTimeout < 0 { return nil, nil, nil, fmt.Errorf("--health-timeout cannot be negative") } + if copts.healthRetries < 0 { + return nil, nil, nil, fmt.Errorf("--health-retries cannot be negative") + } healthConfig = &container.HealthConfig{ Test: probe,