From ada4e9de7e07071f06b8d5bc6b0126091c402c3b Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Sun, 21 Oct 2018 12:37:48 -0700 Subject: [PATCH] allow registry credentials in drone exec --- drone/exec/exec.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drone/exec/exec.go b/drone/exec/exec.go index 316c4da..2782916 100644 --- a/drone/exec/exec.go +++ b/drone/exec/exec.go @@ -79,6 +79,10 @@ var Command = cli.Command{ Name: "network", Usage: "external networks", }, + cli.StringSliceFlag{ + Name: "registry", + Usage: "registry", + }, cli.StringFlag{ Name: "secret-file", Usage: "secret file", @@ -321,11 +325,11 @@ func toRegistry(items []string) []*engine.DockerAuth { if err != nil { continue // skip invalid } - host := uri.Host user := uri.User.Username() pass, _ := uri.User.Password() + uri.User = nil auths = append(auths, &engine.DockerAuth{ - Address: host, + Address: uri.String(), Username: user, Password: pass, })