|
@@ -5,6 +5,7 @@ import (
|
|
"io"
|
|
"io"
|
|
"runtime"
|
|
"runtime"
|
|
"strings"
|
|
"strings"
|
|
|
|
+ "time"
|
|
|
|
|
|
dist "github.com/docker/distribution"
|
|
dist "github.com/docker/distribution"
|
|
"github.com/docker/distribution/reference"
|
|
"github.com/docker/distribution/reference"
|
|
@@ -20,6 +21,7 @@ import (
|
|
// PullImage initiates a pull operation. image is the repository name to pull, and
|
|
// PullImage initiates a pull operation. image is the repository name to pull, and
|
|
// tag may be either empty, or indicate a specific tag to pull.
|
|
// tag may be either empty, or indicate a specific tag to pull.
|
|
func (i *ImageService) PullImage(ctx context.Context, image, tag, os string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error {
|
|
func (i *ImageService) PullImage(ctx context.Context, image, tag, os string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error {
|
|
|
|
+ start := time.Now()
|
|
// Special case: "pull -a" may send an image name with a
|
|
// Special case: "pull -a" may send an image name with a
|
|
// trailing :. This is ugly, but let's not break API
|
|
// trailing :. This is ugly, but let's not break API
|
|
// compatibility.
|
|
// compatibility.
|
|
@@ -44,7 +46,9 @@ func (i *ImageService) PullImage(ctx context.Context, image, tag, os string, met
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- return i.pullImageWithReference(ctx, ref, os, metaHeaders, authConfig, outStream)
|
|
|
|
|
|
+ err = i.pullImageWithReference(ctx, ref, os, metaHeaders, authConfig, outStream)
|
|
|
|
+ imageActions.WithValues("pull").UpdateSince(start)
|
|
|
|
+ return err
|
|
}
|
|
}
|
|
|
|
|
|
func (i *ImageService) pullImageWithReference(ctx context.Context, ref reference.Named, os string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error {
|
|
func (i *ImageService) pullImageWithReference(ctx context.Context, ref reference.Named, os string, metaHeaders map[string][]string, authConfig *types.AuthConfig, outStream io.Writer) error {
|