diff options
author | baude <bbaude@redhat.com> | 2019-01-27 09:57:44 -0600 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-02-05 10:05:41 -0600 |
commit | 64c8fb7c2460eb561c8496f781f26d65443eea59 (patch) | |
tree | 19a7bae6cd3bc117fa7b2e9dfe44d3534b4f75ed /pkg/varlinkapi/images.go | |
parent | 3554bfce98bc643bd4724340bf2abbaa6373e70c (diff) | |
download | podman-64c8fb7c2460eb561c8496f781f26d65443eea59.tar.gz podman-64c8fb7c2460eb561c8496f781f26d65443eea59.tar.bz2 podman-64c8fb7c2460eb561c8496f781f26d65443eea59.zip |
podman-remote import|export
addition of import and export for the podman-remote client. This includes
the ability to send and receive files between the remote-client and the
"podman" host using an upgraded varlink connection.
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/varlinkapi/images.go')
-rw-r--r-- | pkg/varlinkapi/images.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go index 0ab645802..5e0889645 100644 --- a/pkg/varlinkapi/images.go +++ b/pkg/varlinkapi/images.go @@ -500,7 +500,7 @@ func (i *LibpodAPI) Commit(call iopodman.VarlinkCall, name, imageName string, ch } // ImportImage imports an image from a tarball to the image store -func (i *LibpodAPI) ImportImage(call iopodman.VarlinkCall, source, reference, message string, changes []string) error { +func (i *LibpodAPI) ImportImage(call iopodman.VarlinkCall, source, reference, message string, changes []string, delete bool) error { configChanges, err := util.GetImageConfig(changes) if err != nil { return call.ReplyErrorOccurred(err.Error()) @@ -516,6 +516,12 @@ func (i *LibpodAPI) ImportImage(call iopodman.VarlinkCall, source, reference, me if err != nil { return call.ReplyErrorOccurred(err.Error()) } + if delete { + if err := os.Remove(source); err != nil { + return call.ReplyErrorOccurred(err.Error()) + } + } + return call.ReplyImportImage(newImage.ID()) } |