diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-02-07 14:07:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-07 14:07:54 -0500 |
commit | 588c9bb5de08f0c3058a18b401ac87e38cd011be (patch) | |
tree | e633be56c5ee9bdbcbe3b14c562e10f34b5cdf63 /libpod | |
parent | 6716581545f7936ab585b125e2cfc02d2d802f9f (diff) | |
parent | bb37c11651b9a01ff9b5191eb5072cdf0db83a51 (diff) | |
download | podman-588c9bb5de08f0c3058a18b401ac87e38cd011be.tar.gz podman-588c9bb5de08f0c3058a18b401ac87e38cd011be.tar.bz2 podman-588c9bb5de08f0c3058a18b401ac87e38cd011be.zip |
Merge pull request #289 from TomSweeneyRedHat/dev/tsweeney/username
Change un/pwd handling to match Buildah's
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/common/common.go | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/libpod/common/common.go b/libpod/common/common.go index 6af3cd232..932f1f6da 100644 --- a/libpod/common/common.go +++ b/libpod/common/common.go @@ -2,17 +2,9 @@ package common import ( "io" - "strings" - "syscall" cp "github.com/containers/image/copy" "github.com/containers/image/types" - "github.com/pkg/errors" -) - -var ( - // ErrNoPassword is returned if the user did not supply a password - ErrNoPassword = errors.Wrapf(syscall.EINVAL, "password was not supplied") ) // GetCopyOptions constructs a new containers/image/copy.Options{} struct from the given parameters @@ -60,23 +52,3 @@ func IsFalse(str string) bool { func IsValidBool(str string) bool { return IsTrue(str) || IsFalse(str) } - -// ParseRegistryCreds takes a credentials string in the form USERNAME:PASSWORD -// and returns a DockerAuthConfig -func ParseRegistryCreds(creds string) (*types.DockerAuthConfig, error) { - if creds == "" { - return nil, errors.New("no credentials supplied") - } - if !strings.Contains(creds, ":") { - return &types.DockerAuthConfig{ - Username: creds, - Password: "", - }, ErrNoPassword - } - v := strings.SplitN(creds, ":", 2) - cfg := &types.DockerAuthConfig{ - Username: v[0], - Password: v[1], - } - return cfg, nil -} |