fix #1385: .yaml.local (#1497)

Added support for .yaml.local files to override values in .yaml
This commit is contained in:
mmetc 2022-05-18 10:08:37 +02:00 committed by GitHub
parent 635e633520
commit 98f2ac5e7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 1088 additions and 42 deletions

View file

@ -89,7 +89,7 @@ func TestSimulationLoading(t *testing.T) {
},
Crowdsec: &CrowdsecServiceCfg{},
},
err: fmt.Sprintf("while reading '%s': open %s: The system cannot find the file specified.", testXXFullPath, testXXFullPath),
err: fmt.Sprintf("while reading %s: open %s: The system cannot find the file specified.", testXXFullPath, testXXFullPath),
})
} else {
tests = append(tests, struct {
@ -106,7 +106,7 @@ func TestSimulationLoading(t *testing.T) {
},
Crowdsec: &CrowdsecServiceCfg{},
},
err: fmt.Sprintf("while reading '%s': open %s: no such file or directory", testXXFullPath, testXXFullPath),
err: fmt.Sprintf("while reading %s: open %s: no such file or directory", testXXFullPath, testXXFullPath),
})
}
@ -115,7 +115,8 @@ func TestSimulationLoading(t *testing.T) {
if err == nil && test.err != "" {
fmt.Printf("TEST '%s': NOK\n", test.name)
t.Fatalf("%d/%d expected error, didn't get it", idx, len(tests))
} else if test.err != "" {
}
if test.err != "" {
if !strings.HasPrefix(fmt.Sprintf("%s", err), test.err) {
fmt.Printf("TEST '%s': NOK\n", test.name)
t.Fatalf("%d/%d expected '%s' got '%s'", idx, len(tests),