Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

345: Fix audit config #346

Merged
merged 5 commits into from
Jul 13, 2021
Merged

345: Fix audit config #346

merged 5 commits into from
Jul 13, 2021

Conversation

genevieveluyt
Copy link
Contributor

Description

Fixes #345

Type of change
  • Bug fix πŸ›
  • New feature ✨
  • This change requires a documentation update πŸ“–
  • Breaking changes ⚠️
How Has This Been Tested?
  • Test A
  • Test B
Checklist:
  • I have 🎩 my changes (A 🎩 specifically includes pulling down changes, setting them up, and manually testing the changed features and potential side effects to make sure nothing is broken)
  • I have performed a self-review of my own code
  • [NA] I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The test coverage did not decrease
  • [NA] I have signed the appropriate Contributor License Agreement

@ghost ghost added the core label Jul 12, 2021
func getEnabledAuditors(conf config.KubeauditConfig) []string {
auditors := []string{}
for _, auditorName := range AuditorNames {
if enabled, ok := conf.GetEnabledAuditors()[auditorName]; !ok || enabled {
Copy link
Contributor

@dani-santos-code dani-santos-code Jul 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can add a comment here to explain this line(enabled, ok := conf.GetEnabledAuditors()[auditorName]; !ok || enabled)?

// if value is not found in the `conf.GetEnabledAuditors()` map, this means
// it wasn't added to the config file, so it should be enabled by default

Copy link
Contributor

@dani-santos-code dani-santos-code left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing it! I tested locally with a config file and it's working as expected! :)

@@ -2,9 +2,9 @@ name: CI
on:
push:
branches:
- master
- main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

@genevieveluyt genevieveluyt merged commit 9c59e6d into main Jul 13, 2021
@genevieveluyt genevieveluyt deleted the fix-345 branch July 13, 2021 14:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit config does not work as documented
2 participants