mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-09 14:43:24 +00:00
Bugs fixing: use patch to update status and set default GC period
1. Use patch rather status patch in backup sync controller as we have disable status as sub resource 2. Set the GC period with default value if it isn't set Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user