Skip to content

Commit

Permalink
chore: Tweak job pod config to prevent restart on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Oct 4, 2023
1 parent 614ed90 commit 61a9d3a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/util/cmd_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ func createJob(cmd *cobra.Command, conf *config.Global, actionName string) error
},
Spec: batchv1.JobSpec{
ActiveDeadlineSeconds: ptr.To(int64(24 * time.Hour.Seconds())),
BackoffLimit: ptr.To(int32(0)),
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Annotations: map[string]string{
Expand All @@ -205,7 +206,7 @@ func createJob(cmd *cobra.Command, conf *config.Global, actionName string) error
Labels: podLabels,
},
Spec: corev1.PodSpec{
RestartPolicy: corev1.RestartPolicyOnFailure,
RestartPolicy: corev1.RestartPolicyNever,
TerminationGracePeriodSeconds: ptr.To(int64(0)),
Affinity: &corev1.Affinity{
PodAffinity: &corev1.PodAffinity{
Expand Down

0 comments on commit 61a9d3a

Please sign in to comment.