mirror of https://github.com/docker/docs.git
improve image listing
This commit is contained in:
parent
f2bc7ebf1e
commit
35bcba8011
|
@ -210,9 +210,11 @@ func (srv *Server) Images(all bool, filter string) ([]APIImages, error) {
|
||||||
}
|
}
|
||||||
outs := []APIImages{} //produce [] when empty instead of 'null'
|
outs := []APIImages{} //produce [] when empty instead of 'null'
|
||||||
for name, repository := range srv.runtime.repositories.Repositories {
|
for name, repository := range srv.runtime.repositories.Repositories {
|
||||||
if filter != "" && name != filter {
|
if filter != "" {
|
||||||
|
if match, _ := path.Match ( filter, name ); !match {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for tag, id := range repository {
|
for tag, id := range repository {
|
||||||
var out APIImages
|
var out APIImages
|
||||||
image, err := srv.runtime.graph.Get(id)
|
image, err := srv.runtime.graph.Get(id)
|
||||||
|
|
Loading…
Reference in New Issue