client: Rip out HTTP check from docker version

For background to this change please see:
https://github.com/dotcloud/docker/issues/4802
https://github.com/dotcloud/docker/pull/5670

Docker-DCO-1.1-Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com> (github: jmccrohan)
This commit is contained in:
Jonathan McCrohan 2014-05-18 02:00:53 +01:00
Родитель 82712ed67e
Коммит 3cec63d56f
3 изменённых файлов: 0 добавлений и 25 удалений

Просмотреть файл

@ -387,14 +387,6 @@ func (cli *DockerCli) CmdVersion(args ...string) error {
}
fmt.Fprintf(cli.out, "Go version (server): %s\n", remoteVersion.Get("GoVersion"))
fmt.Fprintf(cli.out, "Git commit (server): %s\n", remoteVersion.Get("GitCommit"))
release := utils.GetReleaseVersion()
if release != "" {
fmt.Fprintf(cli.out, "Last stable version: %s", release)
if (dockerversion.VERSION != "" || remoteVersion.Exists("Version")) && (strings.Trim(dockerversion.VERSION, "-dev") != release || strings.Trim(remoteVersion.Get("Version"), "-dev") != release) {
fmt.Fprintf(cli.out, ", please update docker")
}
fmt.Fprintf(cli.out, "\n")
}
return nil
}

Просмотреть файл

@ -26,7 +26,6 @@ func TestVersionEnsureSucceeds(t *testing.T) {
"Server API version:",
"Go version (server):",
"Git commit (server):",
"Last stable version:",
}
for _, linePrefix := range stringsToCheck {

Просмотреть файл

@ -821,22 +821,6 @@ func ParseHost(defaultHost string, defaultUnix, addr string) (string, error) {
return fmt.Sprintf("%s://%s:%d", proto, host, port), nil
}
func GetReleaseVersion() string {
resp, err := http.Get("https://get.docker.io/latest")
if err != nil {
return ""
}
defer resp.Body.Close()
if resp.ContentLength > 24 || resp.StatusCode != 200 {
return ""
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return ""
}
return strings.TrimSpace(string(body))
}
// Get a repos name and returns the right reposName + tag
// The tag can be confusing because of a port in a repository name.
// Ex: localhost.localdomain:5000/samalba/hipache:latest