Remove redundant file check for capi_whitelists_path (#2728)
This commit is contained in:
parent
adba4e2a2f
commit
6960419a2e
|
@ -356,10 +356,6 @@ func (s *LocalApiServerCfg) LoadCapiWhitelists() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, err := os.Stat(s.CapiWhitelistsPath); os.IsNotExist(err) {
|
|
||||||
return fmt.Errorf("capi whitelist file '%s' does not exist", s.CapiWhitelistsPath)
|
|
||||||
}
|
|
||||||
|
|
||||||
fd, err := os.Open(s.CapiWhitelistsPath)
|
fd, err := os.Open(s.CapiWhitelistsPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("while opening capi whitelist file: %s", err)
|
return fmt.Errorf("while opening capi whitelist file: %s", err)
|
||||||
|
|
|
@ -30,7 +30,7 @@ teardown() {
|
||||||
|
|
||||||
@test "capi_whitelists: file missing" {
|
@test "capi_whitelists: file missing" {
|
||||||
rune -0 wait-for \
|
rune -0 wait-for \
|
||||||
--err "capi whitelist file '$CAPI_WHITELISTS_YAML' does not exist" \
|
--err "while opening capi whitelist file: open $CAPI_WHITELISTS_YAML: no such file or directory" \
|
||||||
"${CROWDSEC}"
|
"${CROWDSEC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue