From ff5cb8e864b87d3976b368ae544010f5736d1da2 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Mon, 1 Apr 2013 16:04:44 -0700 Subject: [PATCH] Images can be removed by short-hand ID. Solves #306. --- graph.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/graph.go b/graph.go index 0f65aa205f..0c84dc4252 100644 --- a/graph.go +++ b/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