Fix client version not being pinned when set
@@ -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
}
}
