polaris icon indicating copy to clipboard operation
polaris copied to clipboard

polaris config should selectively override values instead of replacing entire config

Open JoeHCQ1 opened this issue 2 years ago • 8 comments

What happened?

I created a config file as instructed in ./docs/customization/checks.md. Here is my config file:

checks:
  pullPolicyNotAlways: ignore

When I re-ran my scan, I dropped from 71 problems to 0.

Before: image

After: image

Looks like my list of checks replaced the typical list of checks instead of overriding one specific value.

What did you expect to happen?

I expected to only make the pullPolicyNotAlways warning go away, not erase all existing checks.

How can we reproduce this?

Given a helm chart with a lot of warnings and dangers (of varied types), put my config above in a file and point the CLI tool at it with -c polaris_config.yaml and watch it go to zero errors.

Version

7.3.0 + my change in #909

Search

  • [X] I did search for other open and closed issues before opening this.

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Additional context

No response

JoeHCQ1 avatar Feb 02 '23 20:02 JoeHCQ1

Is there a default config we can use in the mean time? The examples/config-full.yaml don't seem up to date.

For instance the topologySpreadConstraint is missing.

DaveOuds avatar Mar 06 '23 15:03 DaveOuds

Agreed this is a pretty big limitation currently--the config is all-or-nothing.

You can use examples/config.yaml--that's our default config.

rbren avatar May 04 '23 16:05 rbren

This issue requests the same feature as described in #770 wich was automatically closed as being stale by the github bot

Flauschbaellchen avatar Jun 13 '23 13:06 Flauschbaellchen

This would be really huge enhancement 🙏

michalschott avatar Jun 15 '23 08:06 michalschott

+1 on the enhancement, also docs should mention the all or nothing functionality, had to dig a little while.

callmegar avatar Jun 22 '23 20:06 callmegar

@rbren Same as #770 , this issue has now been closed as being stale but it was not yet resolved. can you please reopen at least one of them again to keep track of this feature request? It is still a big limitation that a manual config overrides the default one completely.

Flauschbaellchen avatar Aug 31 '23 12:08 Flauschbaellchen

Was this ever resolved? If not, is it something you could consider in the near future? 🙏 It would be awesome not having to overwrite all defaults, when just wanting to add to them, or change a few.

devantler avatar Oct 09 '24 13:10 devantler

I've created an initial implementation PR to address this feature - https://github.com/FairwindsOps/polaris/pull/1075

vitorvezani avatar Oct 09 '24 20:10 vitorvezani