summaryrefslogtreecommitdiff
path: root/cmd/podman/images/push.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-04-22 14:29:51 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-04-22 14:30:40 -0400
commitae1731e03fa13cfaa6d4c244dcb7827c000617e2 (patch)
treed308f47ade944f048690f9e45aee04e9bd3472fd /cmd/podman/images/push.go
parent366fc0520b1503556a177aa2fd29f529f8874544 (diff)
downloadpodman-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/push.go')
-rw-r--r--cmd/podman/images/push.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/images/push.go b/cmd/podman/images/push.go
index f12a5ac86..ef2ffd0d7 100644
--- a/cmd/podman/images/push.go
+++ b/cmd/podman/images/push.go
@@ -1,6 +1,8 @@
package images
import (
+ "os"
+
buildahcli "github.com/containers/buildah/pkg/cli"
"github.com/containers/image/v5/types"
"github.com/containers/libpod/cmd/podman/registry"
@@ -114,6 +116,12 @@ func imagePush(cmd *cobra.Command, args []string) error {
pushOptsAPI.TLSVerify = types.NewOptionalBool(pushOptions.TLSVerifyCLI)
}
+ if pushOptsAPI.Authfile != "" {
+ if _, err := os.Stat(pushOptsAPI.Authfile); err != nil {
+ return errors.Wrapf(err, "error getting authfile %s", pushOptsAPI.Authfile)
+ }
+ }
+
// Let's do all the remaining Yoga in the API to prevent us from scattering
// logic across (too) many parts of the code.
return registry.ImageEngine().Push(registry.GetContext(), source, destination, pushOptsAPI)