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(polaris): Remove clutter from JSON output #493

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

danielpacak
Copy link
Contributor

Resolves: #449

Signed-off-by: Daniel Pacak pacak.daniel@gmail.com

Resolves: #449

Signed-off-by: Daniel Pacak <pacak.daniel@gmail.com>
@@ -9,8 +9,7 @@ import (
"github.com/aquasecurity/starboard/pkg/ext"
"github.com/aquasecurity/starboard/pkg/plugin/polaris"
"github.com/aquasecurity/starboard/pkg/starboard"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/onsi/gomega"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

On the mission to replace Testify with Gomega matchers, which are more powerful and we use them in integration tests.

Copy link
Member

@simar7 simar7 Apr 12, 2021

Choose a reason for hiding this comment

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

Fireside chat: I get the reasoning but I personally would still vote for testify just because I find them simpler to write. gexec is great though for integration tests.

Copy link
Contributor Author

@danielpacak danielpacak Apr 13, 2021

Choose a reason for hiding this comment

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

With testify I struggled many times to assert on complex objects / object trees in unit tests. Only Gomega allowed me to do so. On the other hand keeping and learning 2 assert libraries doesn't really make sense from maintenance stand point. But we can think about it and vote what would be the best option.

"--config", "/etc/starboard/polaris.config.yaml",
"--resource", "default/Deployment.apps/v1/nginx",
"-c",
"polaris audit --log-level error --config /etc/starboard/polaris.config.yaml --resource default/Deployment.apps/v1/nginx 2> /dev/null",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

2> /dev/null to get rid of logs from clinet-go, e.g. rate limit warnings

@codecov
Copy link

codecov bot commented Apr 12, 2021

Codecov Report

Merging #493 (e90cc3c) into main (802cfa7) will decrease coverage by 0.29%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #493      +/-   ##
==========================================
- Coverage   70.25%   69.96%   -0.30%     
==========================================
  Files          62       62              
  Lines        3994     3992       -2     
==========================================
- Hits         2806     2793      -13     
- Misses        892      900       +8     
- Partials      296      299       +3     
Impacted Files Coverage Δ
pkg/plugin/polaris/plugin.go 92.64% <100.00%> (-0.11%) ⬇️
pkg/operator/controller/ciskubebenchreport.go 60.75% <0.00%> (-3.77%) ⬇️
pkg/operator/controller/vulnerabilityreport.go 66.25% <0.00%> (-2.89%) ⬇️
pkg/operator/controller/configauditreport.go 68.10% <0.00%> (+1.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 802cfa7...e90cc3c. Read the comment docs.

Copy link
Member

@simar7 simar7 left a comment

Choose a reason for hiding this comment

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

behold our new saviour gomega

@danielpacak danielpacak merged commit 5cb2c04 into main Apr 13, 2021
@danielpacak danielpacak deleted the remove_clutter_in_polaris_output branch April 13, 2021 05:54
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.

Polaris results parse failed
2 participants