aboutsummaryrefslogtreecommitdiff
path: root/libpod/adapter
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2019-01-11 10:33:25 -0600
committerbaude <bbaude@redhat.com>2019-01-30 08:44:58 -0600
commit735f0de6336fa8db7465ce4aaa5b6de203816aa9 (patch)
tree25ec04f14357a7a65aed89b3ca5d5a33c45d6ef5 /libpod/adapter
parentb71088a01e1e43b87214aaca87c73865fa3b990e (diff)
downloadpodman-735f0de6336fa8db7465ce4aaa5b6de203816aa9.tar.gz
podman-735f0de6336fa8db7465ce4aaa5b6de203816aa9.tar.bz2
podman-735f0de6336fa8db7465ce4aaa5b6de203816aa9.zip
Changes to container runlabel for toolbox project
The toolbox project would benefit from a few changes to more closely resembe the original atomic cli project. Changes made are: * only pull image for container runlabel if the label exists in the image * if a container image does not have the desired label, exit with non-zero Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/adapter')
-rw-r--r--libpod/adapter/runtime.go4
-rw-r--r--libpod/adapter/runtime_remote.go6
2 files changed, 7 insertions, 3 deletions
diff --git a/libpod/adapter/runtime.go b/libpod/adapter/runtime.go
index f4961437e..007257714 100644
--- a/libpod/adapter/runtime.go
+++ b/libpod/adapter/runtime.go
@@ -78,8 +78,8 @@ func (r *LocalRuntime) LoadFromArchiveReference(ctx context.Context, srcRef type
}
// New calls into local storage to look for an image in local storage or to pull it
-func (r *LocalRuntime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *image.DockerRegistryOptions, signingoptions image.SigningOptions, forcePull bool) (*ContainerImage, error) {
- img, err := r.Runtime.ImageRuntime().New(ctx, name, signaturePolicyPath, authfile, writer, dockeroptions, signingoptions, forcePull)
+func (r *LocalRuntime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *image.DockerRegistryOptions, signingoptions image.SigningOptions, forcePull bool, label *string) (*ContainerImage, error) {
+ img, err := r.Runtime.ImageRuntime().New(ctx, name, signaturePolicyPath, authfile, writer, dockeroptions, signingoptions, forcePull, label)
if err != nil {
return nil, err
}
diff --git a/libpod/adapter/runtime_remote.go b/libpod/adapter/runtime_remote.go
index f184ce0a9..0633c036d 100644
--- a/libpod/adapter/runtime_remote.go
+++ b/libpod/adapter/runtime_remote.go
@@ -6,6 +6,7 @@ import (
"context"
"encoding/json"
"fmt"
+ "github.com/pkg/errors"
"io"
"strings"
"time"
@@ -156,7 +157,10 @@ func (r *LocalRuntime) LoadFromArchiveReference(ctx context.Context, srcRef type
}
// New calls into local storage to look for an image in local storage or to pull it
-func (r *LocalRuntime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *image.DockerRegistryOptions, signingoptions image.SigningOptions, forcePull bool) (*ContainerImage, error) {
+func (r *LocalRuntime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *image.DockerRegistryOptions, signingoptions image.SigningOptions, forcePull bool, label *string) (*ContainerImage, error) {
+ if label != nil {
+ return nil, errors.New("the remote client function does not support checking a remote image for a label")
+ }
// TODO Creds needs to be figured out here too, like above
tlsBool := dockeroptions.DockerInsecureSkipTLSVerify
// Remember SkipTlsVerify is the opposite of tlsverify