mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-03 11:45:20 +00:00
Add test skipImmediately is switched to false after reconcile
Signed-off-by: Tiger Kaovilai <tkaovila@redhat.com>
This commit is contained in:
@@ -176,6 +176,12 @@ func TestReconcileOfSchedule(t *testing.T) {
|
||||
require.Nil(t, client.Create(ctx, test.backup))
|
||||
}
|
||||
|
||||
scheduleb4reconcile := &velerov1.Schedule{}
|
||||
err = client.Get(ctx, types.NamespacedName{Namespace: "ns", Name: "name"}, scheduleb4reconcile)
|
||||
if test.schedule != nil {
|
||||
require.Nil(t, err)
|
||||
}
|
||||
|
||||
_, err = reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: types.NamespacedName{Namespace: "ns", Name: "name"}})
|
||||
require.Nil(t, err)
|
||||
|
||||
@@ -200,6 +206,12 @@ func TestReconcileOfSchedule(t *testing.T) {
|
||||
assert.Equal(t, parseTime(test.expectedLastSkipped).Unix(), schedule.Status.LastSkipped.Unix())
|
||||
}
|
||||
|
||||
// we expect reconcile to flip SkipImmediately to false if it's true or the server is configured to skip immediately and the schedule doesn't have it set
|
||||
if scheduleb4reconcile.Spec.SkipImmediately != nil && *scheduleb4reconcile.Spec.SkipImmediately ||
|
||||
test.reconcilerSkipImmediately && scheduleb4reconcile.Spec.SkipImmediately == nil {
|
||||
assert.Equal(t, schedule.Spec.SkipImmediately, pointer.Bool(false))
|
||||
}
|
||||
|
||||
backups := &velerov1.BackupList{}
|
||||
require.Nil(t, client.List(ctx, backups))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user