Skip to content

Commit 60af345

Browse files
[Feature] Add CRD generator for ArangoDeployment (#997)
1 parent 24d464a commit 60af345

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A)
44
- (Feature) Add ArangoSync TLS based rotation
55
- (Bugfix) Fix labels propagation
6+
- (Feature) Add `ArangoDeployment` CRD auto-installer
67

78
## [1.2.13](https://github.com/arangodb/kube-arangodb/tree/1.2.13) (2022-06-07)
89
- (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
@@ -17,6 +17,7 @@ rules:
1717
resources: ["customresourcedefinitions"]
1818
verbs: ["get", "list", "watch", "update", "delete"]
1919
resourceNames:
20+
- "arangodeployments.database.arangodb.com"
2021
- "arangoclustersynchronizations.database.arangodb.com"
2122
- "arangotasks.database.arangodb.com"
2223

pkg/crd/arangodeployments.go

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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("arangodeployments.database.arangodb.com", crd{
31+
version: "1.0.1",
32+
spec: apiextensions.CustomResourceDefinitionSpec{
33+
Group: "database.arangodb.com",
34+
Names: apiextensions.CustomResourceDefinitionNames{
35+
Plural: "arangodeployments",
36+
Singular: "arangodeployment",
37+
ShortNames: []string{
38+
"arangodb",
39+
"arango",
40+
},
41+
Kind: "ArangoDeployment",
42+
ListKind: "ArangoDeploymentList",
43+
},
44+
Scope: apiextensions.NamespaceScoped,
45+
Versions: []apiextensions.CustomResourceDefinitionVersion{
46+
{
47+
Name: "v1",
48+
Schema: &apiextensions.CustomResourceValidation{
49+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
50+
Type: "object",
51+
XPreserveUnknownFields: util.NewBool(true),
52+
},
53+
},
54+
Served: true,
55+
Storage: true,
56+
Subresources: &apiextensions.CustomResourceSubresources{
57+
Status: &apiextensions.CustomResourceSubresourceStatus{},
58+
},
59+
},
60+
{
61+
Name: "v1alpha",
62+
Schema: &apiextensions.CustomResourceValidation{
63+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
64+
Type: "object",
65+
XPreserveUnknownFields: util.NewBool(true),
66+
},
67+
},
68+
Served: true,
69+
Storage: false,
70+
},
71+
{
72+
Name: "v2alpha1",
73+
Schema: &apiextensions.CustomResourceValidation{
74+
OpenAPIV3Schema: &apiextensions.JSONSchemaProps{
75+
Type: "object",
76+
XPreserveUnknownFields: util.NewBool(true),
77+
},
78+
},
79+
Served: true,
80+
Storage: false,
81+
Subresources: &apiextensions.CustomResourceSubresources{
82+
Status: &apiextensions.CustomResourceSubresourceStatus{},
83+
},
84+
},
85+
},
86+
},
87+
})
88+
}

0 commit comments

Comments
 (0)