Skip to content

Commit 9843a56

Browse files
[Feature] Add CRD generator for ArangoJob (#1001)
1 parent 56e6a88 commit 9843a56

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- (Feature) Add `ArangoMember` CRD auto-installer
88
- (Feature) Add `ArangoBackup` CRD auto-installer
99
- (Feature) Add `ArangoBackupPolicy` CRD auto-installer
10+
- (Feature) Add `ArangoJob` CRD auto-installer
1011

1112
## [1.2.13](https://github.com/arangodb/kube-arangodb/tree/1.2.13) (2022-06-07)
1213
- (Bugfix) Fix arangosync members state inspection

chart/kube-arangodb/templates/crd/cluster-role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ rules:
2323
- "arangotasks.database.arangodb.com"
2424
- "arangobackups.backup.arangodb.com"
2525
- "arangobackuppolicies.backup.arangodb.com"
26+
- "arangojobs.apps.arangodb.com"
2627

2728
{{- end }}
2829
{{- end }}

pkg/crd/arangojobs.go

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
//
2+
// DISCLAIMER
3+
//
4+
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
5+
//
6+
// Licensed under the Apache License, Version 2.0 (the "License");
7+
// you may not use this file except in compliance with the License.
8+
// You may obtain a copy of the License at
9+
//
10+
// http://www.apache.org/licenses/LICENSE-2.0
11+
//
12+
// Unless required by applicable law or agreed to in writing, software
13+
// distributed under the License is distributed on an "AS IS" BASIS,
14+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
// See the License for the specific language governing permissions and
16+
// limitations under the License.
17+
//
18+
// Copyright holder is ArangoDB GmbH, Cologne, Germany
19+
//
20+
21+
package crd
22+
23+
import (
24+
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
25+
26+
"github.com/arangodb/kube-arangodb/pkg/util"
27+
)
28+
29+
func init() {
30+
registerCRDWithPanic("arangojobs.apps.arangodb.com", crd{
31+
version: "1.0.1",
32+
spec: apiextensions.CustomResourceDefinitionSpec{
33+
Group: "apps.arangodb.com",
34+
Names: apiextensions.CustomResourceDefinitionNames{
35+
Plural: "arangojobs",
36+
Singular: "arangojob",
37+
Kind: "ArangoJob",
38+
ListKind: "ArangoJobList",
39+
ShortNames: []string{
40+
"arangojob",
41+
},
42+
},
43+
Scope: apiextensions.NamespaceScoped,
44+
Versions: []apiextensions.CustomResourceDefinitionVersion{
45+
{
46+
Name: "v1",
47+
Schema: &apiextensions.CustomResourceValidation{
48+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
49+
Type: "object",
50+
XPreserveUnknownFields: util.NewBool(true),
51+
},
52+
},
53+
Served: true,
54+
Storage: true,
55+
AdditionalPrinterColumns: []apiextensions.CustomResourceColumnDefinition{
56+
{
57+
JSONPath: ".spec.arangoDeploymentName",
58+
Description: "Deployment name",
59+
Name: "ArangoDeploymentName",
60+
Type: "string",
61+
},
62+
},
63+
Subresources: &apiextensions.CustomResourceSubresources{
64+
Status: &apiextensions.CustomResourceSubresourceStatus{},
65+
},
66+
},
67+
},
68+
},
69+
})
70+
}

0 commit comments

Comments
 (0)