diff options
author | baude <bbaude@redhat.com> | 2019-02-12 15:12:09 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-02-13 08:44:12 -0600 |
commit | 7dcc21f21311ee1ff3fe6974d5926bec7d181e5c (patch) | |
tree | c42ceaa09f69e6542a840f416d62ea6e66d7cd31 /cmd/podman/push.go | |
parent | ee27c39f85507993c0a3dfe3c4dfab4c7b7e5e00 (diff) | |
download | podman-7dcc21f21311ee1ff3fe6974d5926bec7d181e5c.tar.gz podman-7dcc21f21311ee1ff3fe6974d5926bec7d181e5c.tar.bz2 podman-7dcc21f21311ee1ff3fe6974d5926bec7d181e5c.zip |
podman-remote push
enable podman-remote push so that users can push images from a
remote client.
change in push API to deal with the need to see output over the
varlink connection.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/push.go')
-rw-r--r-- | cmd/podman/push.go | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/cmd/podman/push.go b/cmd/podman/push.go index 017e4fbd2..bbe8a4027 100644 --- a/cmd/podman/push.go +++ b/cmd/podman/push.go @@ -2,8 +2,6 @@ package main import ( "fmt" - "github.com/containers/libpod/cmd/podman/cliconfig" - "github.com/spf13/cobra" "io" "os" "strings" @@ -11,11 +9,13 @@ import ( "github.com/containers/image/directory" "github.com/containers/image/manifest" "github.com/containers/image/types" - "github.com/containers/libpod/cmd/podman/libpodruntime" + "github.com/containers/libpod/cmd/podman/cliconfig" + "github.com/containers/libpod/libpod/adapter" "github.com/containers/libpod/libpod/image" "github.com/containers/libpod/pkg/util" imgspecv1 "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" + "github.com/spf13/cobra" ) var ( @@ -93,7 +93,7 @@ func pushCmd(c *cliconfig.PushValues) error { registryCreds = creds } - runtime, err := libpodruntime.GetRuntime(&c.PodmanCommand) + runtime, err := adapter.GetRuntime(&c.PodmanCommand) if err != nil { return errors.Wrapf(err, "could not create runtime") } @@ -131,12 +131,7 @@ func pushCmd(c *cliconfig.PushValues) error { SignBy: signBy, } - newImage, err := runtime.ImageRuntime().NewFromLocal(srcName) - if err != nil { - return err - } - authfile := getAuthFile(c.Authfile) - return newImage.PushImageToHeuristicDestination(getContext(), destName, manifestType, authfile, c.SignaturePolicy, writer, c.Compress, so, &dockerRegistryOptions, nil) + return runtime.Push(getContext(), srcName, destName, manifestType, authfile, c.SignaturePolicy, writer, c.Compress, so, &dockerRegistryOptions, nil) } |