diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-22 14:29:51 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-04-22 14:30:40 -0400 |
commit | ae1731e03fa13cfaa6d4c244dcb7827c000617e2 (patch) | |
tree | d308f47ade944f048690f9e45aee04e9bd3472fd /cmd/podman/images/pull.go | |
parent | 366fc0520b1503556a177aa2fd29f529f8874544 (diff) | |
download | podman-ae1731e03fa13cfaa6d4c244dcb7827c000617e2.tar.gz podman-ae1731e03fa13cfaa6d4c244dcb7827c000617e2.tar.bz2 podman-ae1731e03fa13cfaa6d4c244dcb7827c000617e2.zip |
Fix podman push and podman pull to check for authfile
This fixes pull_test.go push_test.go is still broken because of
lack of registry support.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/images/pull.go')
-rw-r--r-- | cmd/podman/images/pull.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/podman/images/pull.go b/cmd/podman/images/pull.go index fb107d00c..f996d0681 100644 --- a/cmd/podman/images/pull.go +++ b/cmd/podman/images/pull.go @@ -2,11 +2,13 @@ package images import ( "fmt" + "os" buildahcli "github.com/containers/buildah/pkg/cli" "github.com/containers/image/v5/types" "github.com/containers/libpod/cmd/podman/registry" "github.com/containers/libpod/pkg/domain/entities" + "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/pflag" ) @@ -99,6 +101,11 @@ func imagePull(cmd *cobra.Command, args []string) error { if cmd.Flags().Changed("tls-verify") { pullOptsAPI.TLSVerify = types.NewOptionalBool(pullOptions.TLSVerifyCLI) } + if pullOptsAPI.Authfile != "" { + if _, err := os.Stat(pullOptsAPI.Authfile); err != nil { + return errors.Wrapf(err, "error getting authfile %s", pullOptsAPI.Authfile) + } + } // Let's do all the remaining Yoga in the API to prevent us from // scattering logic across (too) many parts of the code. |