diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-02-13 18:42:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-13 18:42:00 +0100 |
commit | 62d88558e7637b72ea9ef53d1b3a2d08f2c6a51e (patch) | |
tree | 94834334f7b22ae6e914a3cfabe68c9bf5bde968 /libpod/adapter/runtime_remote.go | |
parent | df52dac1e70ea04dc3de8e7372e23c47f06291d6 (diff) | |
parent | 7dcc21f21311ee1ff3fe6974d5926bec7d181e5c (diff) | |
download | podman-62d88558e7637b72ea9ef53d1b3a2d08f2c6a51e.tar.gz podman-62d88558e7637b72ea9ef53d1b3a2d08f2c6a51e.tar.bz2 podman-62d88558e7637b72ea9ef53d1b3a2d08f2c6a51e.zip |
Merge pull request #2322 from baude/remotepush
podman-remote push
Diffstat (limited to 'libpod/adapter/runtime_remote.go')
-rw-r--r-- | libpod/adapter/runtime_remote.go | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libpod/adapter/runtime_remote.go b/libpod/adapter/runtime_remote.go index 14a7d5652..ab9b4501d 100644 --- a/libpod/adapter/runtime_remote.go +++ b/libpod/adapter/runtime_remote.go @@ -6,12 +6,14 @@ import ( "bufio" "context" "encoding/json" + "fmt" "github.com/pkg/errors" "io" "os" "strings" "time" + "github.com/containers/image/docker/reference" "github.com/containers/image/types" "github.com/containers/libpod/cmd/podman/cliconfig" "github.com/containers/libpod/cmd/podman/varlink" @@ -452,3 +454,29 @@ func (r *LocalRuntime) RemoveVolumes(ctx context.Context, c *cliconfig.VolumeRmV } return iopodman.VolumeRemove().Call(r.Conn, rmOpts) } + +func (r *LocalRuntime) Push(ctx context.Context, srcName, destination, manifestMIMEType, authfile, signaturePolicyPath string, writer io.Writer, forceCompress bool, signingOptions image.SigningOptions, dockerRegistryOptions *image.DockerRegistryOptions, additionalDockerArchiveTags []reference.NamedTagged) error { + + tls := true + if dockerRegistryOptions.DockerInsecureSkipTLSVerify == types.OptionalBoolTrue { + tls = false + } + reply, err := iopodman.PushImage().Send(r.Conn, varlink.More, srcName, destination, tls, signaturePolicyPath, "", dockerRegistryOptions.DockerCertPath, forceCompress, manifestMIMEType, signingOptions.RemoveSignatures, signingOptions.SignBy) + if err != nil { + return err + } + for { + responses, flags, err := reply() + if err != nil { + return err + } + for _, line := range responses.Logs { + fmt.Print(line) + } + if flags&varlink.Continues == 0 { + break + } + } + + return err +} |