Browse Source

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 <zhangwei555@huawei.com>
Zhang Wei 8 năm trước cách đây
mục cha
commit
4d54d30477
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      client/client.go

+ 1 - 1
client/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