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,8 +111,10 @@ func AssertMatchesFile(t *testing.T, actual string, p string) {
|
||||||
|
|
||||||
expectedBytes, err := ioutil.ReadFile(p)
|
expectedBytes, err := ioutil.ReadFile(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if !os.IsNotExist(err) || os.Getenv("HACK_UPDATE_EXPECTED_IN_PLACE") == "" {
|
||||||
t.Fatalf("error reading file %q: %v", p, err)
|
t.Fatalf("error reading file %q: %v", p, err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
expected := strings.TrimSpace(string(expectedBytes))
|
expected := strings.TrimSpace(string(expectedBytes))
|
||||||
|
|
||||||
//on windows, with git set to autocrlf, the reference files on disk have windows line endings
|
//on windows, with git set to autocrlf, the reference files on disk have windows line endings
|
||||||
|
|
Loading…
Reference in New Issue