mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-03 20:21:44 +00:00
[daemon] Refactor image_delete.go
This file was not well documented and had very high cyclomatic complexity. This patch completely rearranges this file and the ImageDelete method to be easier to follow and more maintainable in the future. Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
This commit is contained in:
+8
-3
@@ -233,10 +233,15 @@ func (s *Server) deleteImages(version version.Version, w http.ResponseWriter, r
|
||||
}
|
||||
|
||||
name := vars["name"]
|
||||
force := boolValue(r, "force")
|
||||
noprune := boolValue(r, "noprune")
|
||||
|
||||
list, err := s.daemon.ImageDelete(name, force, noprune)
|
||||
if name == "" {
|
||||
return fmt.Errorf("image name cannot be blank")
|
||||
}
|
||||
|
||||
force := boolValue(r, "force")
|
||||
prune := !boolValue(r, "noprune")
|
||||
|
||||
list, err := s.daemon.ImageDelete(name, force, prune)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user