зеркало из https://github.com/docker/engine-api.git
Add a quite flat to image load for adding progress bar to load
Signed-off-by: Lei Jitang <leijitang@huawei.com>
This commit is contained in:
Родитель
8e06f43466
Коммит
8734fd79cb
|
@ -12,8 +12,13 @@ import (
|
|||
// ImageLoad loads an image in the docker host from the client host.
|
||||
// It's up to the caller to close the io.ReadCloser returned by
|
||||
// this function.
|
||||
func (cli *Client) ImageLoad(ctx context.Context, input io.Reader) (types.ImageLoadResponse, error) {
|
||||
resp, err := cli.postRaw(ctx, "/images/load", url.Values{}, input, nil)
|
||||
func (cli *Client) ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error) {
|
||||
v := url.Values{}
|
||||
v.Set("quiet", "0")
|
||||
if quiet {
|
||||
v.Set("quiet", "1")
|
||||
}
|
||||
resp, err := cli.postRaw(ctx, "/images/load", v, input, nil)
|
||||
if err != nil {
|
||||
return types.ImageLoadResponse{}, err
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ type APIClient interface {
|
|||
ImageImport(ctx context.Context, options types.ImageImportOptions) (io.ReadCloser, error)
|
||||
ImageInspectWithRaw(imageID string, getSize bool) (types.ImageInspect, []byte, error)
|
||||
ImageList(options types.ImageListOptions) ([]types.Image, error)
|
||||
ImageLoad(ctx context.Context, input io.Reader) (types.ImageLoadResponse, error)
|
||||
ImageLoad(ctx context.Context, input io.Reader, quiet bool) (types.ImageLoadResponse, error)
|
||||
ImagePull(ctx context.Context, options types.ImagePullOptions, privilegeFunc RequestPrivilegeFunc) (io.ReadCloser, error)
|
||||
ImagePush(ctx context.Context, options types.ImagePushOptions, privilegeFunc RequestPrivilegeFunc) (io.ReadCloser, error)
|
||||
ImageRemove(options types.ImageRemoveOptions) ([]types.ImageDelete, error)
|
||||
|
|
Загрузка…
Ссылка в новой задаче