From 05455f850573d649236b93835531e4db50c6c67d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sat, 19 Oct 2024 11:58:42 +0200 Subject: [PATCH] cli/command: PromptUserForCredentials: inline isDefaultRegistry remove isDefaultRegistry and inline it where it's used; the code-comment already outlines what we're looking for, so the intermediate var didn't add much currently. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit a55cfe5f82a13105ca49ee70f72ff6ef00400917) Signed-off-by: Sebastiaan van Stijn --- cli/command/registry.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/command/registry.go b/cli/command/registry.go index 642667a11f..51fff10c5f 100644 --- a/cli/command/registry.go +++ b/cli/command/registry.go @@ -125,11 +125,10 @@ func PromptUserForCredentials(ctx context.Context, cli Cli, argUser, argPassword cli.SetIn(streams.NewIn(os.Stdin)) } - isDefaultRegistry := serverAddress == registry.IndexServer defaultUsername = strings.TrimSpace(defaultUsername) if argUser = strings.TrimSpace(argUser); argUser == "" { - if isDefaultRegistry { + if serverAddress == registry.IndexServer { // if this is a default registry (docker hub), then display the following message. fmt.Fprintln(cli.Out(), "Log in with your Docker ID or email address to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com/ to create one.") if hints.Enabled() {