diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c540368..de3e4a744 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - (Feature) Add ArangoSync TLS based rotation - (Bugfix) Fix labels propagation - (Feature) Add `ArangoDeployment` CRD auto-installer +- (Feature) Add `ArangoMember` CRD auto-installer ## [1.2.13](https://github.com/arangodb/kube-arangodb/tree/1.2.13) (2022-06-07) - (Bugfix) Fix arangosync members state inspection diff --git a/chart/kube-arangodb/templates/crd/cluster-role.yaml b/chart/kube-arangodb/templates/crd/cluster-role.yaml index 4bc46b7a2..e818bd191 100644 --- a/chart/kube-arangodb/templates/crd/cluster-role.yaml +++ b/chart/kube-arangodb/templates/crd/cluster-role.yaml @@ -19,6 +19,7 @@ rules: resourceNames: - "arangodeployments.database.arangodb.com" - "arangoclustersynchronizations.database.arangodb.com" + - "arangomembers.database.arangodb.com" - "arangotasks.database.arangodb.com" {{- end }} diff --git a/pkg/crd/arangomembers.go b/pkg/crd/arangomembers.go new file mode 100644 index 000000000..7e81f1853 --- /dev/null +++ b/pkg/crd/arangomembers.go @@ -0,0 +1,76 @@ +// +// DISCLAIMER +// +// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Copyright holder is ArangoDB GmbH, Cologne, Germany +// + +package crd + +import ( + apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + + "github.com/arangodb/kube-arangodb/pkg/util" +) + +func init() { + registerCRDWithPanic("arangomembers.database.arangodb.com", crd{ + version: "1.0.1", + spec: apiextensions.CustomResourceDefinitionSpec{ + Group: "database.arangodb.com", + Names: apiextensions.CustomResourceDefinitionNames{ + Plural: "arangomembers", + Singular: "arangomember", + Kind: "ArangoMember", + ListKind: "ArangoMemberList", + ShortNames: []string{ + "arangomembers", + }, + }, + Scope: apiextensions.NamespaceScoped, + Versions: []apiextensions.CustomResourceDefinitionVersion{ + { + Name: "v1", + Schema: &apiextensions.CustomResourceValidation{ + OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ + Type: "object", + XPreserveUnknownFields: util.NewBool(true), + }, + }, + Served: true, + Storage: true, + Subresources: &apiextensions.CustomResourceSubresources{ + Status: &apiextensions.CustomResourceSubresourceStatus{}, + }, + }, + { + Name: "v2alpha1", + Schema: &apiextensions.CustomResourceValidation{ + OpenAPIV3Schema: &apiextensions.JSONSchemaProps{ + Type: "object", + XPreserveUnknownFields: util.NewBool(true), + }, + }, + Served: true, + Storage: false, + Subresources: &apiextensions.CustomResourceSubresources{ + Status: &apiextensions.CustomResourceSubresourceStatus{}, + }, + }, + }, + }, + }) +}