Ver código fonte

Images can be removed by short-hand ID. Solves #306.

Solomon Hykes 12 anos atrás
pai
commit
ff5cb8e864
1 arquivos alterados com 5 adições e 1 exclusões
  1. 5 1
      graph.go

+ 5 - 1
graph.go

@@ -161,7 +161,11 @@ func isNotEmpty(err error) bool {
 }
 
 // Delete atomically removes an image from the graph.
-func (graph *Graph) Delete(id string) error {
+func (graph *Graph) Delete(name string) error {
+	id, err := graph.idIndex.Get(name)
+	if err != nil {
+		return err
+	}
 	garbage, err := graph.Garbage()
 	if err != nil {
 		return err