Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker -H /var/run/docker.sock always fail #1801

Closed
simonferquel opened this issue Apr 3, 2019 · 7 comments · Fixed by #1802
Closed

docker -H /var/run/docker.sock always fail #1801

simonferquel opened this issue Apr 3, 2019 · 7 comments · Fixed by #1802
Labels

Comments

@simonferquel
Copy link
Contributor

Description

In master, top level flags are parsed twice. This is not a problem for single value flags, but for lists (such as -H), it create duplicate values, which cause issues. As an example, setting -H currently breaks the CLI

Steps to reproduce the issue:

  1. run docker -H /var/run/docker.sock version

Describe the results you received:

Please specify only one -H

Describe the results you expected:

normal version output

Output of docker version:

current master

cc @thaJeztah @silvin-lubecki @vdemeester @ijc

@thaJeztah
Copy link
Member

possible suspect #1722

@ijc
Copy link
Contributor

ijc commented Apr 3, 2019

I thing I know what is wrong here, will look at it today

@ijc
Copy link
Contributor

ijc commented Apr 3, 2019

Apart from this issue (which I will fix), why is -H an array if you can only pass it once?

@thaJeztah
Copy link
Member

thaJeztah commented Apr 3, 2019

Apart from this issue (which I will fix), why is -H an array if you can only pass it once?

It's in common.go;

flags.VarP(hostOpt, "host", "H", "Daemon socket(s) to connect to")

I suspect this is technical debt, from the time that the cli and daemon were in the same repository (and same binary), and some flags were re-used for the cli and daemon-cli 😓

I think all of common.go should be moved/integrated into the other parts of the code

@ijc
Copy link
Contributor

ijc commented Apr 3, 2019

Are you aware of any other list-based global options I could use for an e2e (since if the global -H is fixed to not be a list then an e2e test based on it wouldn't be effective any longer...). I don't see any in that common.go nor in cli/cobra.go

@thaJeztah
Copy link
Member

hm... no, don't think there's any 🤔

@ijc
Copy link
Contributor

ijc commented Apr 3, 2019

OK, nevermind, I'll cope ;-)

ijc pushed a commit to ijc/docker-cli that referenced this issue Apr 3, 2019
These currently fail.

Signed-off-by: Ian Campbell <[email protected]>
ijc pushed a commit to ijc/docker-cli that referenced this issue Apr 3, 2019
These currently fail.

Signed-off-by: Ian Campbell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants