summaryrefslogtreecommitdiff
path: root/pkg/adapter/containers_remote.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-03 20:58:13 +0200
committerGitHub <noreply@github.com>2019-06-03 20:58:13 +0200
commite41162076a2668fa93c61dadaf72d285590c4c6e (patch)
tree573d5d0832cd316eedadb68748b936fe27ef428c /pkg/adapter/containers_remote.go
parent7c465d4d9738f25546d61b915d63bf8fff0ed14d (diff)
parent2df462024bc59fcf117e3c68bd94b667aa0cecd0 (diff)
downloadpodman-e41162076a2668fa93c61dadaf72d285590c4c6e.tar.gz
podman-e41162076a2668fa93c61dadaf72d285590c4c6e.tar.bz2
podman-e41162076a2668fa93c61dadaf72d285590c4c6e.zip
Merge pull request #3081 from baude/remotecommit
podman remote-client commit
Diffstat (limited to 'pkg/adapter/containers_remote.go')
-rw-r--r--pkg/adapter/containers_remote.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkg/adapter/containers_remote.go b/pkg/adapter/containers_remote.go
index 0c0bce813..bc6a9cfcd 100644
--- a/pkg/adapter/containers_remote.go
+++ b/pkg/adapter/containers_remote.go
@@ -994,3 +994,26 @@ func (r *LocalRuntime) GetNamespaces(container shared.PsContainerOutput) *shared
}
return &ns
}
+
+// Commit creates a local image from a container
+func (r *LocalRuntime) Commit(ctx context.Context, c *cliconfig.CommitValues, container, imageName string) (string, error) {
+ var iid string
+ reply, err := iopodman.Commit().Send(r.Conn, varlink.More, container, imageName, c.Change, c.Author, c.Message, c.Pause, c.Format)
+ if err != nil {
+ return "", err
+ }
+ for {
+ responses, flags, err := reply()
+ if err != nil {
+ return "", err
+ }
+ for _, line := range responses.Logs {
+ fmt.Fprintln(os.Stderr, line)
+ }
+ iid = responses.Id
+ if flags&varlink.Continues == 0 {
+ break
+ }
+ }
+ return iid, nil
+}