diff options
author | TomSweeneyRedHat <tsweeney@redhat.com> | 2018-10-16 17:58:12 -0400 |
---|---|---|
committer | TomSweeneyRedHat <tsweeney@redhat.com> | 2018-10-22 19:20:34 -0400 |
commit | e75b3477ce2acf8af49a13e8197401ee00bff459 (patch) | |
tree | 9682264be226052e9ccc4327e3d55e8097c690dc /cmd/podman/common.go | |
parent | 5b2478ed87eedd8178c1672a786f95a6716a8edb (diff) | |
download | podman-e75b3477ce2acf8af49a13e8197401ee00bff459.tar.gz podman-e75b3477ce2acf8af49a13e8197401ee00bff459.tar.bz2 podman-e75b3477ce2acf8af49a13e8197401ee00bff459.zip |
Handle http/https in registry given to login/out
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Diffstat (limited to 'cmd/podman/common.go')
-rw-r--r-- | cmd/podman/common.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go index e342659ed..8ae1c9e0f 100644 --- a/cmd/podman/common.go +++ b/cmd/podman/common.go @@ -465,3 +465,11 @@ func getAuthFile(authfile string) string { } return os.Getenv("REGISTRY_AUTH_FILE") } + +// scrubServer removes 'http://' or 'https://' from the front of the +// server/registry string if either is there. This will be mostly used +// for user input from 'podman login' and 'podman logout'. +func scrubServer(server string) string { + server = strings.TrimPrefix(server, "https://") + return strings.TrimPrefix(server, "http://") +} |