Skip to content

Commit

Permalink
Fix using the index to delay execution
Browse files Browse the repository at this point in the history
It did not actually do a staggered delay for each instance.

Signed-off-by: Simon Beck <simon.beck@vshn.ch>
  • Loading branch information
Kidswiss committed May 13, 2024
1 parent dd9f657 commit 2666a12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion operator/backupcontroller/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 2666a12

Please sign in to comment.