8000 MLCronJob status update · arangodb/kube-arangodb@51ab3ba · GitHub
[go: up one dir, main page]

Skip to content

Commit 51ab3ba

Browse files
committed
MLCronJob status update
1 parent 749c04b commit 51ab3ba

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

chart/kube-arangodb/templates/ml-operator/role.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,9 @@ rules:
5252
- "secrets"
5353
- "serviceaccounts"
5454
verbs: ["*"]
55+
- apiGroups: ["batch"]
56+
resources:
57+
- "cronjobs"
58+
verbs: ["*"]
5559
{{- end }}
5660
{{- end }}

pkg/apis/ml/v1alpha1/cronjob_spec.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
batchApi "k8s.io/api/batch/v1"
2525

2626
"github.com/arangodb/kube-arangodb/pkg/apis/shared"
27+
"github.com/arangodb/kube-arangodb/pkg/util/errors"
2728
)
2829

2930
type ArangoMLCronJobSpec struct {
@@ -33,5 +34,14 @@ type ArangoMLCronJobSpec struct {
3334
}
3435

3536
func (a *ArangoMLCronJobSpec) Validate() error {
36-
return shared.WithErrors(shared.PrefixResourceErrors("spec"))
37+
if a == nil {
38+
return errors.Newf("Spec is not defined")
39+
}
40+
41+
var err []error
42+
if a.CronJobSpec == nil {
43+
err = append(err, shared.PrefixResourceErrors("spec", errors.Newf("CronJobSpec is not defined")))
44+
}
45+
46+
return shared.WithErrors(err...)
3747
}

0 commit comments

Comments
 (0)
0