clean up context on build completion & add test
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack) Upstream-commit: 18587469789594f7ca26fc942c6d23b971a14dd3 Component: engine
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"strings"
|
||||
@ -175,3 +176,20 @@ func waitRun(contId string) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func compareDirectoryEntries(e1 []os.FileInfo, e2 []os.FileInfo) error {
|
||||
var (
|
||||
e1Entries = make(map[string]struct{})
|
||||
e2Entries = make(map[string]struct{})
|
||||
)
|
||||
for _, e := range e1 {
|
||||
e1Entries[e.Name()] = struct{}{}
|
||||
}
|
||||
for _, e := range e2 {
|
||||
e2Entries[e.Name()] = struct{}{}
|
||||
}
|
||||
if !reflect.DeepEqual(e1Entries, e2Entries) {
|
||||
return fmt.Errorf("entries differ")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user