context: ClientOpts() now includes WithAPIVersionNegotiation if version is missing

Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Tibor Vass 2019-04-23 22:23:32 +00:00 committed by Sebastiaan van Stijn
parent a77e3af471
commit c52e1f2487
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 0 deletions

View File

@ -128,6 +128,8 @@ func (c *Endpoint) ClientOpts() ([]client.Opt, error) {
version := os.Getenv("DOCKER_API_VERSION")
if version != "" {
result = append(result, client.WithVersion(version))
} else {
result = append(result, client.WithAPIVersionNegotiation())
}
return result, nil
}