-
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
fix: ignore parsing logs of deleted scan jobs #950
fix: ignore parsing logs of deleted scan jobs #950
Conversation
Codecov Report
@@ Coverage Diff @@
## main #950 +/- ##
==========================================
+ Coverage 64.63% 64.81% +0.17%
==========================================
Files 59 59
Lines 6982 6986 +4
==========================================
+ Hits 4513 4528 +15
+ Misses 2012 2004 -8
+ Partials 457 454 -3
Continue to review full report at Codecov.
|
if errors.IsNotFound(err) { | ||
log.V(1).Info("Ignoring not found job", "job", fmt.Sprintf("%s/%s", job.Namespace, job.Name), "owner", owner) | ||
log.V(1).Info("Deleting complete scan job", "owner", owner) | ||
return r.deleteJob(ctx, job) |
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.
@mycodeself Probably r.deleteJob
will not find a job to delete, due to job not found
.
Maybe it is better to return ctrl.Result{}, nil
to remove it from the cache :
https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/internal/controller/controller.go#L332
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.
@chen-keinan but return ctrl.Result{}, nil
doesn't fit the signature of processCompleteScanJob
it just returns an error. I guess that I should just return nil
right?
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.
@mycodeself FYI, The complete solution has been implemented by #956
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.
Oh ok @chen-keinan thanks for letting me know! I'll watch this PR to continue learning!
Let's close this one and keep working on #956. |
fixes #873 based on @py-go suggestion
Avoid retry parse deleted scan jobs handling the
IsNotFound
error and deleting the job.