diff options
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://") +} |