-
Notifications
You must be signed in to change notification settings - Fork 197
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
feat: Deleting a VulnerabilityReport should trigger rescan #458
Conversation
Codecov Report
@@ Coverage Diff @@
## main #458 +/- ##
==========================================
+ Coverage 69.41% 69.99% +0.57%
==========================================
Files 58 58
Lines 3551 3579 +28
==========================================
+ Hits 2465 2505 +40
+ Misses 801 792 -9
+ Partials 285 282 -3
Continue to review full report at Codecov.
|
24fa807
to
8e9de4c
Compare
Kind: "Pod", | ||
Name: podName, | ||
UID: pod.UID, | ||
APIVersion: "v1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will create a custom Gomega matcher to assert valid VulnerabilityReports controlled by the given workload
@@ -92,7 +92,7 @@ func (b *builder) Get() (v1alpha1.VulnerabilityReport, error) { | |||
}, | |||
Report: b.result, | |||
} | |||
err = controllerutil.SetOwnerReference(b.owner, &report, b.scheme) | |||
err = controllerutil.SetControllerReference(b.owner, &report, b.scheme) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is required to use controller-runtime factories out of the box:
err = ctrl.NewControllerManagedBy(mgr).
For(&appv1.ReplicaSet{}).
Owns(&v1alpa1.VulnerabilityReport{}). // whenever we delete vulnerability report owned by a ReplicaSet, the ReplicaSet gets reconciled
Complete(r.reconcileWorkload(workload.kind))
8e9de4c
to
2fff116
Compare
Resolves: #414
Resolves: #451
Signed-off-by: Daniel Pacak pacak.daniel@gmail.com