|
| 1 | +// |
| 2 | +// DISCLAIMER |
| 3 | +// |
| 4 | +// Copyright 2023-2024 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 v1alpha1 |
| 22 | + |
| 23 | +import ( |
| 24 | + meta "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 25 | + "k8s.io/apimachinery/pkg/runtime" |
| 26 | + "k8s.io/apimachinery/pkg/runtime/schema" |
| 27 | + |
| 28 | + "github.com/arangodb/kube-arangodb/pkg/apis/networking" |
| 29 | +) |
| 30 | + |
| 31 | +const ( |
| 32 | + ArangoPlatformVersion = "v1alpha1" |
| 33 | +) |
| 34 | + |
| 35 | +var ( |
| 36 | + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) |
| 37 | + AddToScheme = SchemeBuilder.AddToScheme |
| 38 | + |
| 39 | + SchemeGroupVersion = schema.GroupVersion{Group: networking.ArangoNetworkingGroupName, Version: ArangoPlatformVersion} |
| 40 | +) |
| 41 | + |
| 42 | +// Resource gets an ArangoCluster GroupResource for a specified resource |
| 43 | +func Resource(resource string) schema.GroupResource { |
| 44 | + return SchemeGroupVersion.WithResource(resource).GroupResource() |
| 45 | +} |
| 46 | + |
| 47 | +// addKnownTypes adds the set of types defined in this package to the supplied scheme. |
| 48 | +func addKnownTypes(s *runtime.Scheme) error { |
| 49 | + s.AddKnownTypes(SchemeGroupVersion, |
| 50 | + &ArangoPlatformStorage{}, |
| 51 | + &ArangoPlatformStorageList{}, |
| 52 | + ) |
| 53 | + meta.AddToGroupVersion(s, SchemeGroupVersion) |
| 54 | + return nil |
| 55 | +} |
0 commit comments