FairwindsOps / polaris

Validation of best practices in your Kubernetes clusters
https://www.fairwinds.com/polaris
Apache License 2.0
3.14k stars 210 forks source link

FWI-5385 Add quiet flag to polaris audit CLI command to suppress 'upload to Insights' prompt #1017

Closed jslivka closed 7 months ago

jslivka commented 7 months ago

This PR addresses #1011

Checklist

Description

Adds the following flag to the polaris audit subcommand:

--quiet                           Suppress the 'upload to Insights' prompt.

What's the goal of this PR?

What changes did you make?

# before
go run main.go audit --audit-path ~/git/fairwinds/charts/stable/insights-agent/insights-manifest.yaml --only-show-failed-tests true --format=pretty

...
Pod insights-insights-agent-delete-jobs
    metadataAndNameMismatched            😬 Warning
        Reliability - Label app.kubernetes.io/name must match metadata.name
    priorityClassNotSet                  😬 Warning
        Reliability - Priority class should be set
    topologySpreadConstraint             😬 Warning
        Reliability - Pod should be configured with a valid topology spread constraint
    automountServiceAccountToken         😬 Warning
        Security - The ServiceAccount will be automounted
    missingNetworkPolicy                 😬 Warning
        Security - A NetworkPolicy should match pod labels and contain applied egress and ingress rules
  Container test
    livenessProbeMissing                 😬 Warning
        Reliability - Liveness probe should be configured
    readinessProbeMissing                😬 Warning
        Reliability - Readiness probe should be configured

πŸš€ Upload your Polaris findings to Fairwinds Insights to see remediation advice, add teammates, integrate with Slack or Jira, and more:
# after
➜  polaris git:(8.3.0) βœ— go run main.go audit --audit-path ~/git/fairwinds/charts/stable/insights-agent/insights-manifest.yaml --only-show-failed-tests true --format=pretty --quiet

...
Pod insights-insights-agent-delete-jobs
    metadataAndNameMismatched            😬 Warning
        Reliability - Label app.kubernetes.io/name must match metadata.name
    automountServiceAccountToken         😬 Warning
        Security - The ServiceAccount will be automounted
    missingNetworkPolicy                 😬 Warning
        Security - A NetworkPolicy should match pod labels and contain applied egress and ingress rules
    priorityClassNotSet                  😬 Warning
        Reliability - Priority class should be set
    topologySpreadConstraint             😬 Warning
        Reliability - Pod should be configured with a valid topology spread constraint
  Container test
    livenessProbeMissing                 😬 Warning
        Reliability - Liveness probe should be configured
    readinessProbeMissing                😬 Warning
        Reliability - Readiness probe should be configured

What alternative solution should we consider, if any?

fairwinds-insights[bot] commented 7 months ago

Fairwinds Insights CI Report

View the Full Report

:white_check_mark: No new Action Items detected!