...
1
16
17 package v1beta1
18
19 import (
20 batchv1beta1 "k8s.io/api/batch/v1beta1"
21 "k8s.io/apimachinery/pkg/runtime"
22 )
23
24 func addDefaultingFuncs(scheme *runtime.Scheme) error {
25 return RegisterDefaults(scheme)
26 }
27
28 func SetDefaults_CronJob(obj *batchv1beta1.CronJob) {
29 if obj.Spec.ConcurrencyPolicy == "" {
30 obj.Spec.ConcurrencyPolicy = batchv1beta1.AllowConcurrent
31 }
32 if obj.Spec.Suspend == nil {
33 obj.Spec.Suspend = new(bool)
34 }
35 if obj.Spec.SuccessfulJobsHistoryLimit == nil {
36 obj.Spec.SuccessfulJobsHistoryLimit = new(int32)
37 *obj.Spec.SuccessfulJobsHistoryLimit = 3
38 }
39 if obj.Spec.FailedJobsHistoryLimit == nil {
40 obj.Spec.FailedJobsHistoryLimit = new(int32)
41 *obj.Spec.FailedJobsHistoryLimit = 1
42 }
43 }
44
View as plain text