Skip to content

Commit

Permalink
Make OnFailure as default restartPolicy for broadcastjob
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Urkade <shubhamurkade1@gmail.com>
  • Loading branch information
Shubham Urkade authored and Shubham Urkade committed Feb 28, 2023
1 parent 1ece7fe commit 9836a38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apis/apps/defaults/v1alpha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ func SetDefaultsBroadcastJob(obj *v1alpha1.BroadcastJob, injectTemplateDefaults
if obj.Spec.FailurePolicy.Type == "" {
obj.Spec.FailurePolicy.Type = v1alpha1.FailurePolicyTypeFailFast
}

// Default to 'OnFailure' if no restartPolicy is specified
if obj.Spec.Template.Spec.RestartPolicy == "" {
obj.Spec.Template.Spec.RestartPolicy = corev1.RestartPolicyOnFailure
}
}

// SetDefaults_UnitedDeployment set default values for UnitedDeployment.
Expand Down

0 comments on commit 9836a38

Please sign in to comment.