|
| 1 | +// |
| 2 | +// DISCLAIMER |
| 3 | +// |
| 4 | +// Copyright 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 | + |
| 26 | + "github.com/arangodb/kube-arangodb/pkg/apis/networking" |
| 27 | +) |
| 28 | + |
| 29 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 30 | + |
| 31 | +// ArangoPlatformStorageList is a list of ArangoPlatform Storage. |
| 32 | +type ArangoPlatformStorageList struct { |
| 33 | + meta.TypeMeta `json:",inline"` |
| 34 | + meta.ListMeta `json:"metadata,omitempty"` |
| 35 | + |
| 36 | + Items []ArangoPlatformStorage `json:"items"` |
| 37 | +} |
| 38 | + |
| 39 | +// +genclient |
| 40 | +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object |
| 41 | + |
| 42 | +// ArangoPlatformStorage contains definition and status of the ArangoPlatform Storage. |
| 43 | +type ArangoPlatformStorage struct { |
| 44 | + meta.TypeMeta `json:",inline"` |
| 45 | + meta.ObjectMeta `json:"metadata,omitempty"` |
| 46 | + |
| 47 | + Spec ArangoPlatformStorageSpec `json:"spec"` |
| 48 | + Status ArangoPlatformStorageStatus `json:"status"` |
| 49 | +} |
| 50 | + |
| 51 | +// AsOwner creates an OwnerReference for the given Extension |
| 52 | +func (a *ArangoPlatformStorage) AsOwner() meta.OwnerReference { |
| 53 | + trueVar := true |
| 54 | + return meta.OwnerReference{ |
| 55 | + APIVersion: SchemeGroupVersion.String(), |
| 56 | + Kind: networking.ArangoRouteResourceKind, |
| 57 | + Name: a.Name, |
| 58 | + UID: a.UID, |
| 59 | + Controller: &trueVar, |
| 60 | + } |
| 61 | +} |
| 62 | + |
| 63 | +func (a *ArangoPlatformStorage) GetStatus() ArangoPlatformStorageStatus { |
| 64 | + return a.Status |
| 65 | +} |
| 66 | + |
| 67 | +func (a *ArangoPlatformStorage) SetStatus(status ArangoPlatformStorageStatus) { |
| 68 | + a.Status = status |
| 69 | +} |
0 commit comments