소스 검색

Merge pull request #23316 from dnephin/error_on_invalid_docker_host

Fix a panic when the DOCKER_HOST was invalid using cobra commands
Brian Goff 9 년 전
부모
커밋
c077d4cc1e
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      cli/cobraadaptor/adaptor.go

+ 3 - 1
cli/cobraadaptor/adaptor.go

@@ -72,7 +72,9 @@ func (c CobraAdaptor) Usage() []cli.Command {
 }
 
 func (c CobraAdaptor) run(cmd string, args []string) error {
-	c.dockerCli.Initialize()
+	if err := c.dockerCli.Initialize(); err != nil {
+		return err
+	}
 	// Prepend the command name to support normal cobra command delegation
 	c.rootCmd.SetArgs(append([]string{cmd}, args...))
 	return c.rootCmd.Execute()