summaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
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/varlinkapi
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/varlinkapi')
-rw-r--r--pkg/varlinkapi/images.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/varlinkapi/images.go b/pkg/varlinkapi/images.go
index c4809f16b..2dfb84e58 100644
--- a/pkg/varlinkapi/images.go
+++ b/pkg/varlinkapi/images.go
@@ -688,12 +688,18 @@ func (i *LibpodAPI) ExportImage(call iopodman.VarlinkCall, name, destination str
}
// PullImage pulls an image from a registry to the image store.
-func (i *LibpodAPI) PullImage(call iopodman.VarlinkCall, name string) error {
+func (i *LibpodAPI) PullImage(call iopodman.VarlinkCall, name string, creds iopodman.AuthConfig) error {
var (
imageID string
err error
)
- dockerRegistryOptions := image.DockerRegistryOptions{}
+ dockerRegistryOptions := image.DockerRegistryOptions{
+ DockerRegistryCreds: &types.DockerAuthConfig{
+ Username: creds.Username,
+ Password: creds.Password,
+ },
+ }
+
so := image.SigningOptions{}
if call.WantsMore() {