mirror of https://github.com/kubernetes/kops.git
dev: hack/update-expected.sh should generate missing file
Don't treat a failure to read a file as an error, if we are supposed to be generating that file.
This commit is contained in:
parent
c54394c0e3
commit
58dccb0c5d
|
@ -111,7 +111,9 @@ func AssertMatchesFile(t *testing.T, actual string, p string) {
|
|||
|
||||
expectedBytes, err := ioutil.ReadFile(p)
|
||||
if err != nil {
|
||||
t.Fatalf("error reading file %q: %v", p, err)
|
||||
if !os.IsNotExist(err) || os.Getenv("HACK_UPDATE_EXPECTED_IN_PLACE") == "" {
|
||||
t.Fatalf("error reading file %q: %v", p, err)
|
||||
}
|
||||
}
|
||||
expected := strings.TrimSpace(string(expectedBytes))
|
||||
|
||||
|
|
Loading…
Reference in New Issue