:= / var
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
This commit is contained in:
parent
e7cc88c39f
commit
c7f825c0f0
|
@ -780,8 +780,10 @@ func (cli *DockerCli) CmdPort(args ...string) error {
|
|||
|
||||
// 'docker rmi IMAGE' removes all images with the name IMAGE
|
||||
func (cli *DockerCli) CmdRmi(args ...string) error {
|
||||
cmd := cli.Subcmd("rmi", "IMAGE [IMAGE...]", "Remove one or more images")
|
||||
force := cmd.Bool([]string{"f", "-force"}, false, "Force")
|
||||
var (
|
||||
cmd = cli.Subcmd("rmi", "IMAGE [IMAGE...]", "Remove one or more images")
|
||||
force = cmd.Bool([]string{"f", "-force"}, false, "Force")
|
||||
)
|
||||
if err := cmd.Parse(args); err != nil {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1812,10 +1812,10 @@ func (srv *Server) ContainerDestroy(job *engine.Job) engine.Status {
|
|||
func (srv *Server) DeleteImage(name string, imgs *engine.Table, first, force bool) error {
|
||||
var (
|
||||
repoName, tag string
|
||||
img, err = srv.runtime.repositories.LookupImage(name)
|
||||
tags = []string{}
|
||||
)
|
||||
|
||||
img, err := srv.runtime.repositories.LookupImage(name)
|
||||
if err != nil {
|
||||
return fmt.Errorf("No such image: %s", name)
|
||||
}
|
||||
|
@ -1873,8 +1873,7 @@ func (srv *Server) DeleteImage(name string, imgs *engine.Table, first, force boo
|
|||
if err := srv.runtime.repositories.DeleteAll(img.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
err := srv.runtime.graph.Delete(img.ID)
|
||||
if err != nil {
|
||||
if err := srv.runtime.graph.Delete(img.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
out := &engine.Env{}
|
||||
|
@ -1898,7 +1897,7 @@ func (srv *Server) ImageDelete(job *engine.Job) engine.Status {
|
|||
if n := len(job.Args); n != 1 {
|
||||
return job.Errorf("Usage: %s IMAGE", job.Name)
|
||||
}
|
||||
var imgs = engine.NewTable("", 0)
|
||||
imgs := engine.NewTable("", 0)
|
||||
if err := srv.DeleteImage(job.Args[0], imgs, true, job.GetenvBool("force")); err != nil {
|
||||
return job.Error(err)
|
||||
}
|
||||
|
|
|
@ -974,8 +974,10 @@ func NewReadCloserWrapper(r io.Reader, closer func() error) io.ReadCloser {
|
|||
}
|
||||
|
||||
func CompareVersion(a, b string) int {
|
||||
aa := strings.Split(a, ".")
|
||||
bb := strings.Split(b, ".")
|
||||
var (
|
||||
aa = strings.Split(a, ".")
|
||||
bb = strings.Split(b, ".")
|
||||
)
|
||||
for i, s := range aa {
|
||||
var ai, bi int
|
||||
ai, _ = strconv.Atoi(s)
|
||||
|
|
Loading…
Reference in New Issue