Merge pull request #4981 from ywk253100/220610_status

Bugs fixing: use patch to update status and set default GC period
This commit is contained in:
Xun Jiang/Bruce Jiang
2022-06-13 09:20:01 +08:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -337,7 +337,7 @@ func (c *backupSyncController) run() {
// update the location's last-synced time field
statusPatch := client.MergeFrom(location.DeepCopy())
location.Status.LastSyncedTime = &metav1.Time{Time: time.Now().UTC()}
if err := c.kbClient.Status().Patch(context.Background(), &location, statusPatch); err != nil {
if err := c.kbClient.Patch(context.Background(), &location, statusPatch); err != nil {
log.WithError(errors.WithStack(err)).Error("Error patching backup location's last-synced time")
continue
}
+1 -1
View File
@@ -79,7 +79,7 @@ func NewGCController(
c.syncHandler = c.processQueueItem
c.resyncPeriod = frequency
if c.resyncPeriod < 0 {
if c.resyncPeriod <= 0 {
c.resyncPeriod = defaultGCFrequency
}
logger.Infof("Garbage collection frequency: %s", c.resyncPeriod.String())