浏览代码

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)
Jonathan McCrohan 11 年之前
父节点
当前提交
3cec63d56f
共有 3 个文件被更改,包括 0 次插入25 次删除
  1. 0 8
      api/client/commands.go
  2. 0 1
      integration-cli/docker_cli_version_test.go
  3. 0 16
      utils/utils.go

+ 0 - 8
api/client/commands.go

@@ -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, "Go version (server): %s\n", remoteVersion.Get("GoVersion"))
 	fmt.Fprintf(cli.out, "Git commit (server): %s\n", remoteVersion.Get("GitCommit"))
 	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
 	return nil
 }
 }
 
 

+ 0 - 1
integration-cli/docker_cli_version_test.go

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

+ 0 - 16
utils/utils.go

@@ -821,22 +821,6 @@ func ParseHost(defaultHost string, defaultUnix, addr string) (string, error) {
 	return fmt.Sprintf("%s://%s:%d", proto, host, port), nil
 	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
 // Get a repos name and returns the right reposName + tag
 // The tag can be confusing because of a port in a repository name.
 // The tag can be confusing because of a port in a repository name.
 //     Ex: localhost.localdomain:5000/samalba/hipache:latest
 //     Ex: localhost.localdomain:5000/samalba/hipache:latest