summaryrefslogtreecommitdiff
path: root/pkg/adapter/runtime_remote.go
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-03-19 14:37:58 -0400
committerQi Wang <qiwan@redhat.com>2020-03-19 14:38:12 -0400
commit9ac58fd78e4f04f3807f18020124882ad68e3ffb (patch)
tree503c17531b38724992645c7e6b2712390ef52329 /pkg/adapter/runtime_remote.go
parent173f430852e52a1acf69b4d9d18da20893031a79 (diff)
downloadpodman-9ac58fd78e4f04f3807f18020124882ad68e3ffb.tar.gz
podman-9ac58fd78e4f04f3807f18020124882ad68e3ffb.tar.bz2
podman-9ac58fd78e4f04f3807f18020124882ad68e3ffb.zip
Use creds form PullImage remote
fix #5511 Adds creds argument to PullImage API and Enables podman-remote to pull image with --creds Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'pkg/adapter/runtime_remote.go')
-rw-r--r--pkg/adapter/runtime_remote.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/adapter/runtime_remote.go b/pkg/adapter/runtime_remote.go
index 220d4cf75..6387c10dd 100644
--- a/pkg/adapter/runtime_remote.go
+++ b/pkg/adapter/runtime_remote.go
@@ -288,7 +288,8 @@ func (r *LocalRuntime) NewImageFromLocal(name string) (*ContainerImage, error) {
// LoadFromArchiveReference creates an image from a local archive
func (r *LocalRuntime) LoadFromArchiveReference(ctx context.Context, srcRef types.ImageReference, signaturePolicyPath string, writer io.Writer) ([]*ContainerImage, error) {
var iid string
- reply, err := iopodman.PullImage().Send(r.Conn, varlink.More, srcRef.DockerReference().String())
+ creds := iopodman.AuthConfig{}
+ reply, err := iopodman.PullImage().Send(r.Conn, varlink.More, srcRef.DockerReference().String(), creds)
if err != nil {
return nil, err
}
@@ -320,7 +321,12 @@ func (r *LocalRuntime) New(ctx context.Context, name, signaturePolicyPath, authf
if label != nil {
return nil, errors.New("the remote client function does not support checking a remote image for a label")
}
- reply, err := iopodman.PullImage().Send(r.Conn, varlink.More, name)
+ creds := iopodman.AuthConfig{}
+ if dockeroptions.DockerRegistryCreds != nil {
+ creds.Username = dockeroptions.DockerRegistryCreds.Username
+ creds.Password = dockeroptions.DockerRegistryCreds.Password
+ }
+ reply, err := iopodman.PullImage().Send(r.Conn, varlink.More, name, creds)
if err != nil {
return nil, err
}