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: remove compliance specKind field #1016

Conversation

chen-keinan
Copy link
Contributor

remove specKind field from compliance reports

@chen-keinan chen-keinan requested a review from danielpacak March 10, 2022 10:49
@codecov
Copy link

codecov bot commented Mar 10, 2022

Codecov Report

Merging #1016 (644c6e4) into main (91d9278) will increase coverage by 0.17%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1016      +/-   ##
==========================================
+ Coverage   58.00%   58.18%   +0.17%     
==========================================
  Files          70       70              
  Lines        9097     9100       +3     
==========================================
+ Hits         5277     5295      +18     
+ Misses       3293     3281      -12     
+ Partials      527      524       -3     
Impacted Files Coverage Δ
pkg/compliance/io.go 87.77% <100.00%> (+0.20%) ⬆️
pkg/configauditreport/controller.go 61.41% <0.00%> (-0.93%) ⬇️
pkg/operator/controller/vulnerabilityreport.go 58.84% <0.00%> (+1.52%) ⬆️
pkg/operator/controller/ciskubebenchreport.go 56.17% <0.00%> (+5.17%) ⬆️

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 91d9278...644c6e4. Read the comment docs.

@chen-keinan chen-keinan force-pushed the fix/remove-compliance-report-spec-kind branch from e042ec3 to 644c6e4 Compare March 10, 2022 10:56
@@ -105,7 +105,10 @@ func (w *cm) createComplianceDetailReport(ctx context.Context, spec v1alpha1.Rep
ObjectMeta: metav1.ObjectMeta{
Name: name,
},
Report: v1alpha1.ClusterComplianceDetailReportData{UpdateTimestamp: metav1.NewTime(ext.NewSystemClock().Now()), Summary: summary, Type: v1alpha1.Compliance{Kind: strings.ToLower(spec.Kind), Name: name, Description: strings.ToLower(spec.Description), Version: spec.Version}, ControlChecks: controlChecksDetails},
Report: v1alpha1.ClusterComplianceDetailReportData{UpdateTimestamp: metav1.NewTime(ext.NewSystemClock().Now()),
Copy link
Contributor

@danielpacak danielpacak Mar 10, 2022

Choose a reason for hiding this comment

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

It's not directly related to this PR, but I spot it right now.

Using ext.NewSystemClock().Now() instead of injecting ext.Clock interface doesn't make much sense. You could just use time.Now() and keep this code untestable.

The ext.Clock interface was introduce to easily swap implementation of the clock in unit tests from ext.NewSystemClock() to ext.NewFixedClock(fixedTime time.Time) with dependency injection pattern.

@danielpacak danielpacak added this to the Release v0.15.0 milestone Mar 10, 2022
@danielpacak danielpacak merged commit 0a82ac2 into aquasecurity:main Mar 10, 2022
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.

2 participants