From 336e901c1ee25278e3a374552896602a83fb2d5a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 4 Mar 2021 22:16:40 -0500 Subject: [PATCH] fix: add some simple validation --- plugins/registry/subcommands.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/registry/subcommands.go b/plugins/registry/subcommands.go index 6a6493cb0..4e7fb2c8d 100644 --- a/plugins/registry/subcommands.go +++ b/plugins/registry/subcommands.go @@ -20,6 +20,16 @@ func CommandLogin(server string, username string, password string, passwordStdin password = strings.TrimSpace(string(stdin)) } + if server == "" { + return errors.New("Missing server argument") + } + if username == "" { + return errors.New("Missing username argument") + } + if password == "" { + return errors.New("Missing password argument") + } + command := []string{ common.DockerBin(), "login",