|
| 1 | +// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"). You may |
| 4 | +// not use this file except in compliance with the License. A copy of the |
| 5 | +// License is located at |
| 6 | +// |
| 7 | +// http://aws.amazon.com/apache2.0/ |
| 8 | +// |
| 9 | +// or in the "license" file accompanying this file. This file is distributed |
| 10 | +// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 11 | +// express or implied. See the License for the specific language governing |
| 12 | +// permissions and limitations under the License. |
| 13 | + |
| 14 | +package v1alpha1 |
| 15 | + |
| 16 | +import ( |
| 17 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 18 | +) |
| 19 | + |
| 20 | +// FieldExportTarget provides the values necessary to identify the |
| 21 | +// output path for a field export. |
| 22 | +type FieldExportTarget struct { |
| 23 | + Name *string `json:"name"` |
| 24 | + // Namespace is marked as optional, so we cannot compose `NamespacedName` |
| 25 | + Namespace *string `json:"namespace,omitempty"` |
| 26 | + Kind FieldExportOutputType `json:"kind"` |
| 27 | +} |
| 28 | + |
| 29 | +// FieldExportSpec defines the desired state of the FieldExport. |
| 30 | +type FieldExportSpec struct { |
| 31 | + From *ResourceFieldSelector `json:"from"` |
| 32 | + To *FieldExportTarget `json:"to"` |
| 33 | +} |
| 34 | + |
| 35 | +// FieldExportStatus defines the observed status of the FieldExport. |
| 36 | +type FieldExportStatus struct { |
| 37 | + // A collection of `ackv1alpha1.Condition` objects that describe the various |
| 38 | + // recoverable states of the field CR |
| 39 | + Conditions []*Condition `json:"conditions"` |
| 40 | +} |
| 41 | + |
| 42 | +// FieldExport is the schema for the FieldExport API. |
| 43 | +// +kubebuilder:object:root=true |
| 44 | +// +kubebuilder:subresource:status |
| 45 | +type FieldExport struct { |
| 46 | + metav1.TypeMeta `json:",inline"` |
| 47 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 48 | + Spec FieldExportSpec `json:"spec,omitempty"` |
| 49 | + Status FieldExportStatus `json:"status,omitempty"` |
| 50 | +} |
| 51 | + |
| 52 | +// FieldExportList defines a list of FieldExports. |
| 53 | +// +kubebuilder:object:root=true |
| 54 | +type FieldExportList struct { |
| 55 | + metav1.TypeMeta `json:",inline"` |
| 56 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 57 | + Items []FieldExport `json:"items"` |
| 58 | +} |
| 59 | + |
| 60 | +func init() { |
| 61 | + SchemeBuilder.Register(&FieldExport{}, &FieldExportList{}) |
| 62 | +} |
0 commit comments