mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Made calling changelog before run return empty. Fixes #1705.
This commit is contained in:
parent
84431ec03c
commit
46c9c5c843
2 changed files with 11 additions and 2 deletions
|
@ -99,7 +99,7 @@ func Changes(layers []string, rw string) ([]Change, error) {
|
|||
changes = append(changes, change)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
return nil, err
|
||||
}
|
||||
return changes, nil
|
||||
|
|
|
@ -138,12 +138,21 @@ func TestDiff(t *testing.T) {
|
|||
container1, _, _ := mkContainer(runtime, []string{"_", "/bin/rm", "/etc/passwd"}, t)
|
||||
defer runtime.Destroy(container1)
|
||||
|
||||
// The changelog should be empty and not fail before run. See #1705
|
||||
c, err := container1.Changes()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(c) != 0 {
|
||||
t.Fatalf("Changelog should be empty before run")
|
||||
}
|
||||
|
||||
if err := container1.Run(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Check the changelog
|
||||
c, err := container1.Changes()
|
||||
c, err = container1.Changes()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue