filter image listing using path.Match

This commit is contained in:
Martin Redmond
2013-09-06 16:16:10 -04:00
parent 35bcba8011
commit b44d113120
2 changed files with 56 additions and 2 deletions
+2 -2
View File
@@ -211,7 +211,7 @@ func (srv *Server) Images(all bool, filter string) ([]APIImages, error) {
outs := []APIImages{} //produce [] when empty instead of 'null'
for name, repository := range srv.runtime.repositories.Repositories {
if filter != "" {
if match, _ := path.Match ( filter, name ); !match {
if match, _ := path.Match(filter, name); !match {
continue
}
}
@@ -681,7 +681,7 @@ func (srv *Server) getImageList(localRepo map[string]string) ([][]*registry.ImgD
depGraph.NewNode(img.ID)
img.WalkHistory(func(current *Image) error {
imgList[current.ID] = &registry.ImgData{
ID: current.ID,
ID: current.ID,
Tag: tag,
}
parent, err := current.GetParent()