mirror of https://github.com/docker/cli.git
context: Endpoint.ClientOpts(): use client.WithVersionFromEnv()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
1db2da57c8
commit
04347f793d
|
@ -6,7 +6,6 @@ import (
|
||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/docker/cli/cli/connhelper"
|
"github.com/docker/cli/cli/connhelper"
|
||||||
|
@ -122,12 +121,7 @@ func (c *Endpoint) ClientOpts() ([]client.Opt, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
version := os.Getenv("DOCKER_API_VERSION")
|
result = append(result, client.WithVersionFromEnv(), client.WithAPIVersionNegotiation())
|
||||||
if version != "" {
|
|
||||||
result = append(result, client.WithVersion(version))
|
|
||||||
} else {
|
|
||||||
result = append(result, client.WithAPIVersionNegotiation())
|
|
||||||
}
|
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue