From 2666a12679d72a2167151bdadbd9cf3e4f279451 Mon Sep 17 00:00:00 2001 From: Simon Beck Date: Mon, 13 May 2024 12:50:07 +0200 Subject: [PATCH] Fix using the index to delay execution It did not actually do a staggered delay for each instance. Signed-off-by: Simon Beck --- operator/backupcontroller/executor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator/backupcontroller/executor.go b/operator/backupcontroller/executor.go index f09034a22..46cf8aa9c 100644 --- a/operator/backupcontroller/executor.go +++ b/operator/backupcontroller/executor.go @@ -262,7 +262,7 @@ func (b *BackupExecutor) startBackup(ctx context.Context) error { if index > 0 { batchJob.job.Spec.Template.Spec.Containers[0].Env = append(batchJob.job.Spec.Template.Spec.Containers[0].Env, corev1.EnvVar{ Name: "SLEEP_DURATION", - Value: (5 * time.Second).String(), + Value: (time.Duration(index) * time.Second).String(), }) } b.backup.Spec.AppendEnvFromToContainer(&batchJob.job.Spec.Template.Spec.Containers[0])