mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix client version not being pinned when set
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
6dfd5bd74f
commit
3d72963ab8
1 changed files with 4 additions and 2 deletions
|
@ -45,8 +45,9 @@ func FromEnv(c *Client) error {
|
|||
}
|
||||
|
||||
if version := os.Getenv("DOCKER_API_VERSION"); version != "" {
|
||||
c.version = version
|
||||
c.manualOverride = true
|
||||
if err := WithVersion(version)(c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -139,6 +140,7 @@ func WithTLSClientConfig(cacertPath, certPath, keyPath string) func(*Client) err
|
|||
func WithVersion(version string) func(*Client) error {
|
||||
return func(c *Client) error {
|
||||
c.version = version
|
||||
c.manualOverride = true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue