Skip to content

Commit

Permalink
Add warning log for snapshot data mover fell backup to Velero native …
Browse files Browse the repository at this point in the history
…snapshot. (#6602)

Enlarge throttle of UT case TestThrottle_ShouldOutput to avoid occasional CI
failure due to timeout caused by test environment's CPU speed

Signed-off-by: Xun Jiang <jxun@vmware.com>
  • Loading branch information
blackpiglet authored Aug 4, 2023
1 parent d027a16 commit 1777bbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions pkg/backup/item_backupper.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@ func (ib *itemBackupper) takePVSnapshot(obj runtime.Unstructured, log logrus.Fie
// After that, this warning can be removed.
if boolptr.IsSetToTrue(ib.backupRequest.Spec.SnapshotMoveData) {
log.Warnf("VolumeSnapshotter plugin doesn't support data movement.")

if features.IsEnabled(velerov1api.CSIFeatureFlag) && pv.Spec.CSI == nil {
log.Warn("Cannot use CSI data mover to handle PV, because PV doesn't contain CSI in spec.",
" Fall back to Velero native snapshot.")
}
}

if ib.backupRequest.ResPolicies != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/uploader/kopia/progress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestThrottle_ShouldOutput(t *testing.T) {
expectedOutput bool
}{
{interval: time.Second, expectedOutput: true},
{interval: time.Second, throttle: time.Now().UnixNano() + int64(time.Nanosecond*10000), expectedOutput: false},
{interval: time.Second, throttle: time.Now().UnixNano() + int64(time.Nanosecond*100000000), expectedOutput: false},
}
p := new(Progress)
for _, tc := range testCases {
Expand Down

0 comments on commit 1777bbe

Please sign in to comment.