Skip to content

Commit

Permalink
Use BackoffLimit=0 for backup/restore job (#1216)
Browse files Browse the repository at this point in the history
Signed-off-by: Emruz Hossain <emruz@appscode.com>

Fixes #1216
  • Loading branch information
hossainemruz authored Oct 21, 2020
1 parent a206a9c commit 40a233c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/backup_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (c *StashController) ensureBackupJob(invoker apis.Invoker, targetInfo apis.
in.Spec.Template.Spec = podSpec
in.Spec.Template.Spec.ImagePullSecrets = imagePullSecrets
in.Spec.Template.Spec.ServiceAccountName = serviceAccountName
in.Spec.BackoffLimit = types.Int32P(1)
in.Spec.BackoffLimit = types.Int32P(0)
return in
},
metav1.PatchOptions{},
Expand Down Expand Up @@ -466,7 +466,7 @@ func (c *StashController) ensureVolumeSnapshotterJob(invoker apis.Invoker, targe
in.Spec.Template.Spec.ImagePullSecrets = imagePullSecrets
in.Spec.Template.Spec.ServiceAccountName = serviceAccountName

in.Spec.BackoffLimit = types.Int32P(1)
in.Spec.BackoffLimit = types.Int32P(0)
return in
},
metav1.PatchOptions{},
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/restore_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ func (c *StashController) createRestoreJob(jobTemplate *core.PodTemplateSpec, me
core_util.EnsureOwnerReference(&in.ObjectMeta, owner)

in.Spec.Template = *jobTemplate
in.Spec.BackoffLimit = types.Int32P(1)
in.Spec.BackoffLimit = types.Int32P(0)
return in
},
metav1.PatchOptions{},
Expand Down Expand Up @@ -803,7 +803,7 @@ func (c *StashController) ensureVolumeRestorerJob(invoker apis.RestoreInvoker, i
in.Spec.Template = *jobTemplate
in.Spec.Template.Spec.ImagePullSecrets = imagePullSecrets
in.Spec.Template.Spec.ServiceAccountName = serviceAccountName
in.Spec.BackoffLimit = types.Int32P(1)
in.Spec.BackoffLimit = types.Int32P(0)
return in
},
metav1.PatchOptions{},
Expand Down

0 comments on commit 40a233c

Please sign in to comment.