Skip to content

Commit

Permalink
Make OnFailure as default restartPolicy for broadcastjob (#1149)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Urkade <shubhamurkade1@gmail.com>
Co-authored-by: Shubham Urkade <surkade@surkade3MD6M.vmware.com>
  • Loading branch information
Shubhamurkade and Shubham Urkade authored Mar 22, 2023
1 parent f41e27d commit 99a3dae
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 99a3dae

Please sign in to comment.