-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
cli/command/system: prettyPrintServerInfo: don't depend on IndexServerAddress and credential-store #4205
cli/command/system: prettyPrintServerInfo: don't depend on IndexServerAddress and credential-store #4205
Conversation
Starting with b4ca1c7, docker login no longer depends on info.IndexServerAddress to determine the default registry. The prettyPrintServerInfo() still depended on this information, which could potentially show the wrong information. This patch changes it to also depend on the same information as docker login now does. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Make this function only _print_ the info we have, and not read the username from the credential-store. This patch adds a Username field to the (local) `info` type, and sets it when needed, so that prettyPrintServerInfo only has to format and print the information, instead of calling out to the credential-store. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
…info Set the client's API version that's used in the info, instead of requesting it as part of printing. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4205 +/- ##
==========================================
- Coverage 58.86% 58.85% -0.01%
==========================================
Files 572 572
Lines 49544 49538 -6
==========================================
- Hits 29162 29158 -4
Misses 18616 18616
+ Partials 1766 1764 -2 |
} | ||
} | ||
|
||
fprintlnNonEmpty(dockerCli.Out(), " Username:", info.UserName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, I'm also very much leaning towards moving this information to the Client:
section, because nothing about it is part of the "Server:".
I think this was historically because it depended on the server (?) but no real idea.
Also;
- because it's not part of the actual
info.Info
struct (i.e., theServer
part), it's currently not even possible to usedocker info --format <template>
to show the name - ^^ so
docker info --format=json
won't show it - ^^ AND if a credentials-helper is used, it's not even filled in at all (it only looks in the config file
- 🙃 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So ... perhaps we should either remove it altogether, or make it use the actual credential-store in use, BUT reading info from that is not always .. fast, and I don't want docker info
to become slow 😓
cli/command/system: prettyPrintServerInfo: simplify username
Starting with b4ca1c7 (#2819), docker login no longer depends on info.IndexServerAddress to determine the default registry.
The prettyPrintServerInfo() still depended on this information, which could potentially show the wrong information.
This patch changes it to also depend on the same information as docker login now does.
cli/command/system: prettyPrintServerInfo: move out collecting username
Make this function only print the info we have, and not read the username
from the credential-store.
This patch adds a Username field to the (local)
info
type, and sets itwhen needed, so that prettyPrintServerInfo only has to format and print
the information, instead of calling out to the credential-store.
cli/command/system: printServerWarnings: use client API version from info
Set the client's API version that's used in the info, instead of requesting
it as part of printing.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)