mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 14:21:18 +00:00
equip gc controller with configurable frequency
Signed-off-by: allenxu404 <qix2@vmware.com>
This commit is contained in:
@@ -34,10 +34,11 @@ import (
|
||||
velerotest "github.com/vmware-tanzu/velero/pkg/test"
|
||||
)
|
||||
|
||||
func mockGCReconciler(fakeClient kbclient.Client, fakeClock *clock.FakeClock) *gcReconciler {
|
||||
func mockGCReconciler(fakeClient kbclient.Client, fakeClock *clock.FakeClock, freq time.Duration) *gcReconciler {
|
||||
gcr := NewGCReconciler(
|
||||
velerotest.NewLogger(),
|
||||
fakeClient,
|
||||
freq,
|
||||
)
|
||||
gcr.clock = fakeClock
|
||||
return gcr
|
||||
@@ -137,7 +138,7 @@ func TestGCReconcile(t *testing.T) {
|
||||
}
|
||||
|
||||
fakeClient := velerotest.NewFakeControllerRuntimeClient(t, initObjs...)
|
||||
reconciler := mockGCReconciler(fakeClient, fakeClock)
|
||||
reconciler := mockGCReconciler(fakeClient, fakeClock, defaultGCFrequency)
|
||||
_, err := reconciler.Reconcile(context.TODO(), ctrl.Request{NamespacedName: types.NamespacedName{Namespace: test.backup.Namespace, Name: test.backup.Name}})
|
||||
gotErr := err != nil
|
||||
assert.Equal(t, test.expectError, gotErr)
|
||||
|
||||
Reference in New Issue
Block a user