mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Port 'docker images' to the engine API
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
This commit is contained in:
parent
6652416f4c
commit
17a806c8a0
10 changed files with 270 additions and 175 deletions
|
@ -186,8 +186,6 @@ func NewTestEngine(t utils.Fataler) *engine.Engine {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
eng.Stdout = ioutil.Discard
|
||||
eng.Stderr = ioutil.Discard
|
||||
// Load default plugins
|
||||
// (This is manually copied and modified from main() until we have a more generic plugin system)
|
||||
job := eng.Job("initapi")
|
||||
|
@ -329,3 +327,22 @@ func fakeTar() (io.Reader, error) {
|
|||
tw.Close()
|
||||
return buf, nil
|
||||
}
|
||||
|
||||
func getAllImages(eng *engine.Engine, t *testing.T) *engine.Table {
|
||||
return getImages(eng, t, true, "")
|
||||
}
|
||||
|
||||
func getImages(eng *engine.Engine, t *testing.T, all bool, filter string) *engine.Table {
|
||||
job := eng.Job("images")
|
||||
job.SetenvBool("all", all)
|
||||
job.Setenv("filter", filter)
|
||||
images, err := job.Stdout.AddTable()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := job.Run(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
return images
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue