From 20ded0afd962de543f5ee8fd42c76fe3e49d4281 Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Mon, 21 Nov 2016 17:31:46 +0800 Subject: [PATCH] Bugfix: set cli.manualOverride when env var not empty If env var "DOCKER_API_VERSION" is specified by user, we'll set `cli.manualOverride`, before this, this field is always true due to wrong logic. Signed-off-by: Zhang Wei --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 814c537c65..a85b392674 100644 --- a/client.go +++ b/client.go @@ -122,7 +122,7 @@ func NewEnvClient() (*Client, error) { if err != nil { return cli, err } - if version != "" { + if os.Getenv("DOCKER_API_VERSION") != "" { cli.manualOverride = true } return cli, nil