summaryrefslogtreecommitdiff
path: root/libpod/adapter
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-01-10 12:15:33 -0600
committerbaude <bbaude@redhat.com>2019-01-11 11:30:28 -0600
commit43c6da22b976b6050f86dca50564a4c2b08caee0 (patch)
treeb8cc80c9e8318ee72031c74a401567a5d5f68392 /libpod/adapter
parent28c35cab8750f379a418e87ed6bd874a12ec158d (diff)
downloadpodman-43c6da22b976b6050f86dca50564a4c2b08caee0.tar.gz
podman-43c6da22b976b6050f86dca50564a4c2b08caee0.tar.bz2
podman-43c6da22b976b6050f86dca50564a4c2b08caee0.zip
Add darwin support for remote-client
Add the ability to cross-compile podman remote for OSX. Also, add image exists and tag to remote-client. Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/adapter')
-rw-r--r--libpod/adapter/runtime_remote.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/libpod/adapter/runtime_remote.go b/libpod/adapter/runtime_remote.go
index 2f22dd36b..0fe5c449a 100644
--- a/libpod/adapter/runtime_remote.go
+++ b/libpod/adapter/runtime_remote.go
@@ -66,6 +66,7 @@ type remoteImage struct {
Names []string
Digest digest.Digest
isParent bool
+ Runtime *LocalRuntime
}
// GetImages returns a slice of containerimages over a varlink connection
@@ -80,7 +81,7 @@ func (r *LocalRuntime) GetImages() ([]*ContainerImage, error) {
if len(i.RepoTags) > 1 {
name = i.RepoTags[0]
}
- newImage, err := imageInListToContainerImage(i, name)
+ newImage, err := imageInListToContainerImage(i, name, r)
if err != nil {
return nil, err
}
@@ -89,7 +90,7 @@ func (r *LocalRuntime) GetImages() ([]*ContainerImage, error) {
return newImages, nil
}
-func imageInListToContainerImage(i iopodman.ImageInList, name string) (*ContainerImage, error) {
+func imageInListToContainerImage(i iopodman.ImageInList, name string, runtime *LocalRuntime) (*ContainerImage, error) {
imageParts, err := image.DecomposeString(name)
if err != nil {
return nil, err
@@ -111,6 +112,7 @@ func imageInListToContainerImage(i iopodman.ImageInList, name string) (*Containe
Repository: imageParts.Registry,
Names: i.RepoTags,
isParent: i.IsParent,
+ Runtime: runtime,
}
return &ContainerImage{ri}, nil
}
@@ -121,7 +123,7 @@ func (r *LocalRuntime) NewImageFromLocal(name string) (*ContainerImage, error) {
if err != nil {
return nil, err
}
- return imageInListToContainerImage(img, name)
+ return imageInListToContainerImage(img, name, r)
}
@@ -173,3 +175,13 @@ func (ci *ContainerImage) Labels(ctx context.Context) (map[string]string, error)
func (ci *ContainerImage) Dangling() bool {
return len(ci.Names()) == 0
}
+
+// TagImage ...
+func (ci *ContainerImage) TagImage(tag string) error {
+ _, err := iopodman.TagImage().Call(ci.Runtime.Conn, ci.ID(), tag)
+ return err
+}
+
+func (r RemoteRuntime) RemoveImage(force bool) error {
+ return nil
+}