Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(multi): Support grouping by resource in multi resource mode #320

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

doronkg
Copy link
Contributor

@doronkg doronkg commented Jun 23, 2024

What this PR does / why we need it?

This PR adds support to use --group-by=resource flag in multi resource mode.
In addition, it improves the output by adding newlines in similar to --group-by=namespace output.

$ .\main.exe sa,clusterrole --group-by=resource -o json
{
  "ClusterRole": {
    "": [
      "aaa"
    ]
  },
  "ServiceAccount": {
    "kube-system": [
      "tes2t"
  }
}

PR Checklist

  • This PR adds K8s exceptions (false positives)
  • This PR adds new code
  • This PR includes tests for new/existing code
  • This PR adds docs

GitHub Issue

Closes #289

@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2024

Codecov Report

Attention: Patch coverage is 0% with 30 lines in your changes missing coverage. Please review.

Project coverage is 41.74%. Comparing base (bc2cca8) to head (7ef8742).

Files Patch % Lines
pkg/kor/multi.go 0.00% 29 Missing ⚠️
pkg/kor/formatter.go 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #320      +/-   ##
==========================================
- Coverage   41.77%   41.74%   -0.03%     
==========================================
  Files          61       61              
  Lines        3179     3181       +2     
==========================================
  Hits         1328     1328              
- Misses       1637     1639       +2     
  Partials      214      214              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@doronkg doronkg changed the title fix: Support grouping by resource in multi resource mode fix(multi): Support grouping by resource in multi resource mode Jun 23, 2024
Copy link
Owner

@yonahd yonahd left a comment

Choose a reason for hiding this comment

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

LGTM

@yonahd yonahd merged commit c39910e into yonahd:main Jun 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG(multi): Grouping by resource doesn't work in multi resource mode
3 participants