Skip to content

Conversation

@lifubang
Copy link
Contributor

Signed-off-by: Lifubang lifubang@acmcoder.com

- What I did
When use ssh host, docker logs need user to type password twice.

root@dockerdemo:~/gocode/src/github.com/docker/cli# docker -H ssh://localhost logs test1
root@localhost's password: (First time)
root@localhost's password: (Second time)
1:C 11 Oct 03:41:51.863 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 11 Oct 03:41:51.863 # Redis version=4.0.11, bits=64, commit=00000000, modified=0, pid=1, just started

- How I did it
Because ContainerInspect is behind ContainerLogs, but ContainerLogs don't close the response, so ContainerInspect can't reuse the connection.
So, move ContainerInspect to the ahead of ContainerLogs.

- How to verify it

root@dockerdemo:~/gocode/src/github.com/docker/cli# build/docker -H ssh://localhost logs test1
root@localhost's password: (Just once)
1:C 11 Oct 03:41:51.863 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 11 Oct 03:41:51.863 # Redis version=4.0.11, bits=64, commit=00000000, modified=0, pid=1, just started

- Description for the changelog
Move ContainerInspect to the ahead of ContainerLogs, so we can reuse docker host connection.

- A picture of a cute animal (not mandatory but encouraged)
n o wn5glp4xjfbgq evcv

@lifubang
Copy link
Contributor Author

@AkihiroSuda PTAL

@codecov-io
Copy link

codecov-io commented Oct 22, 2018

Codecov Report

Merging #1472 into master will decrease coverage by <.01%.
The diff coverage is 50%.

@@            Coverage Diff             @@
##           master    #1472      +/-   ##
==========================================
- Coverage   54.19%   54.19%   -0.01%     
==========================================
  Files         289      289              
  Lines       19382    19377       -5     
==========================================
- Hits        10505    10502       -3     
- Misses       8198     8199       +1     
+ Partials      679      676       -3

Signed-off-by: Lifubang <lifubang@acmcoder.com>
Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @lifubang !

@silvin-lubecki silvin-lubecki merged commit 6b71e84 into docker:master Oct 26, 2018
@GordonTheTurtle GordonTheTurtle added this to the 19.03.0 milestone Oct 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants