1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #38909 from thaJeztah/fix_version_override

Fix client version not being pinned when set
This commit is contained in:
Tibor Vass 2019-03-21 14:14:39 -07:00 committed by GitHub
commit 6cce52c245
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,8 +45,9 @@ func FromEnv(c *Client) error {
} }
if version := os.Getenv("DOCKER_API_VERSION"); version != "" { if version := os.Getenv("DOCKER_API_VERSION"); version != "" {
c.version = version if err := WithVersion(version)(c); err != nil {
c.manualOverride = true return err
}
} }
return nil return nil
} }
@ -139,6 +140,7 @@ func WithTLSClientConfig(cacertPath, certPath, keyPath string) func(*Client) err
func WithVersion(version string) func(*Client) error { func WithVersion(version string) func(*Client) error {
return func(c *Client) error { return func(c *Client) error {
c.version = version c.version = version
c.manualOverride = true
return nil return nil
} }
} }