diff options
author | umohnani8 <umohnani@redhat.com> | 2018-04-30 14:25:15 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-04-30 20:22:29 +0000 |
commit | 52ace66e76ca2854e58ded9d337a3ff1d26a9202 (patch) | |
tree | a9de8d9c5bff0f7e79eaad1010bb05d7347b39b6 /vendor | |
parent | d5d6e6859286ab9310e4a79082d50c816941f1ae (diff) | |
download | podman-52ace66e76ca2854e58ded9d337a3ff1d26a9202.tar.gz podman-52ace66e76ca2854e58ded9d337a3ff1d26a9202.tar.bz2 podman-52ace66e76ca2854e58ded9d337a3ff1d26a9202.zip |
Vendor in latest containers/image
Fixes podman pull to pull a public image even if $XDG_RUNTIME_DIR
does not exist for authentication. Public images don't require credentials
to access.
Signed-off-by: umohnani8 <umohnani@redhat.com>
Closes: #701
Approved by: rhatdan
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/containers/image/pkg/docker/config/config.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/vendor/github.com/containers/image/pkg/docker/config/config.go b/vendor/github.com/containers/image/pkg/docker/config/config.go index 1238208fb..3edab0539 100644 --- a/vendor/github.com/containers/image/pkg/docker/config/config.go +++ b/vendor/github.com/containers/image/pkg/docker/config/config.go @@ -15,6 +15,7 @@ import ( "github.com/docker/docker-credential-helpers/credentials" "github.com/docker/docker/pkg/homedir" "github.com/pkg/errors" + "github.com/sirupsen/logrus" ) type dockerAuthConfig struct { @@ -64,11 +65,17 @@ func GetAuthentication(sys *types.SystemContext, registry string) (string, strin } dockerLegacyPath := filepath.Join(homedir.Get(), dockerLegacyCfg) + var paths []string pathToAuth, err := getPathToAuth(sys) - if err != nil { - return "", "", err + if err == nil { + paths = append(paths, pathToAuth) + } else { + // Error means that the path set for XDG_RUNTIME_DIR does not exist + // but we don't want to completely fail in the case that the user is pulling a public image + // Logging the error as a warning instead and moving on to pulling the image + logrus.Warnf("%v: Trying to pull image in the event that it is a public image.", err) } - paths := [3]string{pathToAuth, filepath.Join(homedir.Get(), dockerCfg, dockerCfgFileName), dockerLegacyPath} + paths = append(paths, filepath.Join(homedir.Get(), dockerCfg, dockerCfgFileName), dockerLegacyPath) for _, path := range paths { legacyFormat := path == dockerLegacyPath |