Remove redundant file check for capi_whitelists_path (#2728)

This commit is contained in:
mmetc 2024-01-12 14:17:01 +01:00 committed by GitHub
parent adba4e2a2f
commit 6960419a2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View file

@ -356,10 +356,6 @@ func (s *LocalApiServerCfg) LoadCapiWhitelists() error {
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)
if err != nil {
return fmt.Errorf("while opening capi whitelist file: %s", err)

View file

@ -30,7 +30,7 @@ teardown() {
@test "capi_whitelists: file missing" {
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}"
}