-
Notifications
You must be signed in to change notification settings - Fork 188
K8SPSMDB-1202 add logs for scheduled backup cleanup #2381
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
Changes from 1 commit
43235b7
af65c5e
979909c
82a8217
b19d248
c451228
99b1037
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,10 +164,16 @@ func (r *ReconcilePerconaServerMongoDB) deleteOldBackupTasks(ctx context.Context | |
| return true | ||
| } | ||
|
|
||
| if len(oldjobs) > 0 { | ||
| log.Info("cleaning up old backups based on retention count", | ||
| "job", item.Name, "keep", ret.Count, "toDelete", len(oldjobs)) | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we have this log when, at the same time we are iterating |
||
|
|
||
| for _, todel := range oldjobs { | ||
| log.Info("deleting outdated backup", "job", item.Name, "backup", todel.Name) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would't say that these old jobs are outdated, they are not. They are just exceeding retention. Maybe we can say
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: |
||
| err = r.client.Delete(ctx, &todel) | ||
| if err != nil { | ||
| log.Error(err, "failed to delete backup object") | ||
| log.Error(err, "failed to delete backup object", "backup", todel.Name) | ||
|
Comment on lines
167
to
+171
|
||
| return true | ||
|
Comment on lines
+168
to
172
Comment on lines
+168
to
172
Comment on lines
+168
to
172
|
||
| } | ||
| } | ||
|
|
||
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.
@nmarukovich please check these comments
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.
yeap valid point