Skip to content

Commit

Permalink
Make OnFailure as default restartPolicy for broadcastjob (openkruise#…
Browse files Browse the repository at this point in the history
…1149)

Signed-off-by: Shubham Urkade <shubhamurkade1@gmail.com>
Co-authored-by: Shubham Urkade <surkade@surkade3MD6M.vmware.com>
  • Loading branch information
2 people authored and diannaowa committed Jun 2, 2023
1 parent 45151ad commit cd95dd3
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 cd95dd3

Please sign in to comment.