diff --git a/pkg/fedvolumebackup/backupschedule/backup_schedule_manager_test.go b/pkg/fedvolumebackup/backupschedule/backup_schedule_manager_test.go index 2a6e7246fe..754e6da464 100644 --- a/pkg/fedvolumebackup/backupschedule/backup_schedule_manager_test.go +++ b/pkg/fedvolumebackup/backupschedule/backup_schedule_manager_test.go @@ -231,10 +231,10 @@ func TestCalculateExpiredBackups(t *testing.T) { var ( now = time.Now() - last10Min = now.Add(-time.Minute * 10).Unix() - last1Day = now.Add(-time.Hour * 24 * 1).Unix() - last2Day = now.Add(-time.Hour * 24 * 2).Unix() - last3Day = now.Add(-time.Hour * 24 * 3).Unix() + last10Min = now.Add(-time.Minute * 10) + last1Day = now.Add(-time.Hour * 24 * 1) + last2Day = now.Add(-time.Hour * 24 * 2) + last3Day = now.Add(-time.Hour * 24 * 3) ) testCases := []*testCase{ @@ -387,12 +387,12 @@ func (h *helper) updateBackup(bk *v1alpha1.VolumeBackup) { }, time.Second*10).Should(BeNil()) } -func fakeBackup(ts *int64) *v1alpha1.VolumeBackup { +func fakeBackup(ts *time.Time) *v1alpha1.VolumeBackup { backup := &v1alpha1.VolumeBackup{} if ts == nil { return backup } - backup.Status.CommitTs = getTSOStr(*ts) + backup.CreationTimestamp = metav1.Time{Time: *ts} return backup }