|
| 1 | +/* |
| 2 | +Copyright 2020 The Kubernetes authors. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package v1 |
| 18 | + |
| 19 | +import ( |
| 20 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 21 | + addonv1alpha1 "sigs.k8s.io/kubebuilder-declarative-pattern/pkg/patterns/addon/pkg/apis/v1alpha1" |
| 22 | +) |
| 23 | + |
| 24 | +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! |
| 25 | +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. |
| 26 | + |
| 27 | +// AdmiralSpec defines the desired state of Admiral |
| 28 | +type AdmiralSpec struct { |
| 29 | + addonv1alpha1.CommonSpec `json:",inline"` |
| 30 | + addonv1alpha1.PatchSpec `json:",inline"` |
| 31 | + |
| 32 | + // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster |
| 33 | + // Important: Run "make" to regenerate code after modifying this file |
| 34 | +} |
| 35 | + |
| 36 | +// AdmiralStatus defines the observed state of Admiral |
| 37 | +type AdmiralStatus struct { |
| 38 | + addonv1alpha1.CommonStatus `json:",inline"` |
| 39 | + |
| 40 | + // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster |
| 41 | + // Important: Run "make" to regenerate code after modifying this file |
| 42 | +} |
| 43 | + |
| 44 | +// +kubebuilder:object:root=true |
| 45 | +// +kubebuilder:resource:scope=Cluster |
| 46 | + |
| 47 | +// Admiral is the Schema for the admirals API |
| 48 | +type Admiral struct { |
| 49 | + metav1.TypeMeta `json:",inline"` |
| 50 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 51 | + |
| 52 | + Spec AdmiralSpec `json:"spec,omitempty"` |
| 53 | + Status AdmiralStatus `json:"status,omitempty"` |
| 54 | +} |
| 55 | + |
| 56 | +var _ addonv1alpha1.CommonObject = &Admiral{} |
| 57 | + |
| 58 | +func (o *Admiral) ComponentName() string { |
| 59 | + return "admiral" |
| 60 | +} |
| 61 | + |
| 62 | +func (o *Admiral) CommonSpec() addonv1alpha1.CommonSpec { |
| 63 | + return o.Spec.CommonSpec |
| 64 | +} |
| 65 | + |
| 66 | +func (o *Admiral) PatchSpec() addonv1alpha1.PatchSpec { |
| 67 | + return o.Spec.PatchSpec |
| 68 | +} |
| 69 | + |
| 70 | +func (o *Admiral) GetCommonStatus() addonv1alpha1.CommonStatus { |
| 71 | + return o.Status.CommonStatus |
| 72 | +} |
| 73 | + |
| 74 | +func (o *Admiral) SetCommonStatus(s addonv1alpha1.CommonStatus) { |
| 75 | + o.Status.CommonStatus = s |
| 76 | +} |
| 77 | + |
| 78 | +// +kubebuilder:object:root=true |
| 79 | +// +kubebuilder:resource:scope=Cluster |
| 80 | + |
| 81 | +// AdmiralList contains a list of Admiral |
| 82 | +type AdmiralList struct { |
| 83 | + metav1.TypeMeta `json:",inline"` |
| 84 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 85 | + Items []Admiral `json:"items"` |
| 86 | +} |
| 87 | + |
| 88 | +func init() { |
| 89 | + SchemeBuilder.Register(&Admiral{}, &AdmiralList{}) |
| 90 | +} |
0 commit comments