mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
remove useless http call from export
Signed-off-by: He Simei <hesimei@zju.edu.cn>
This commit is contained in:
parent
6cba3109c2
commit
6d9439c627
1 changed files with 3 additions and 14 deletions
|
@ -3,7 +3,6 @@ package client
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"net/url"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
flag "github.com/docker/docker/pkg/mflag"
|
flag "github.com/docker/docker/pkg/mflag"
|
||||||
|
@ -34,19 +33,9 @@ func (cli *DockerCli) CmdExport(args ...string) error {
|
||||||
return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
|
return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(cmd.Args()) == 1 {
|
image := cmd.Arg(0)
|
||||||
image := cmd.Arg(0)
|
if err := cli.stream("GET", "/containers/"+image+"/export", nil, output, nil); err != nil {
|
||||||
if err := cli.stream("GET", "/containers/"+image+"/export", nil, output, nil); err != nil {
|
return err
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
v := url.Values{}
|
|
||||||
for _, arg := range cmd.Args() {
|
|
||||||
v.Add("names", arg)
|
|
||||||
}
|
|
||||||
if err := cli.stream("GET", "/containers/get?"+v.Encode(), nil, output, nil); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue