|
| 1 | +/* |
| 2 | +
|
| 3 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +you may not use this file except in compliance with the License. |
| 5 | +You may obtain a copy of the License at |
| 6 | +
|
| 7 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +
|
| 9 | +Unless required by applicable law or agreed to in writing, software |
| 10 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +See the License for the specific language governing permissions and |
| 13 | +limitations under the License. |
| 14 | +*/ |
| 15 | + |
| 16 | +package v1alpha2 |
| 17 | + |
| 18 | +import ( |
| 19 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 20 | +) |
| 21 | + |
| 22 | +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! |
| 23 | +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. |
| 24 | + |
| 25 | +// TalosConfigSpec defines the desired state of TalosConfig |
| 26 | +type TalosConfigSpec struct { |
| 27 | + MachineType string `json:"machineType,omitempty"` |
| 28 | + // Important: Run "make" to regenerate code after modifying this file |
| 29 | +} |
| 30 | + |
| 31 | +// TalosConfigStatus defines the observed state of TalosConfig |
| 32 | +type TalosConfigStatus struct { |
| 33 | + // Ready indicates the BootstrapData field is ready to be consumed |
| 34 | + Ready bool `json:"ready,omitempty"` |
| 35 | + |
| 36 | + // BootstrapData will be a slice of bootstrap data |
| 37 | + // +optional |
| 38 | + BootstrapData []byte `json:"bootstrapData,omitempty"` |
| 39 | + |
| 40 | + // Talos config will be a string containing the config for download |
| 41 | + // +optional |
| 42 | + TalosConfig string `json:"talosConfig,omitempty"` |
| 43 | + |
| 44 | + // ErrorReason will be set on non-retryable errors |
| 45 | + // +optional |
| 46 | + ErrorReason string `json:"errorReason,omitempty"` |
| 47 | + |
| 48 | + // ErrorMessage will be set on non-retryable errors |
| 49 | + // +optional |
| 50 | + ErrorMessage string `json:"errorMessage,omitempty"` |
| 51 | +} |
| 52 | + |
| 53 | +// +kubebuilder:object:root=true |
| 54 | +// +kubebuilder:storageversion |
| 55 | +// +kubebuilder:resource:path=talosconfigs,scope=Namespaced,categories=cluster-api |
| 56 | +// +kubebuilder:subresource:status |
| 57 | + |
| 58 | +// TalosConfig is the Schema for the talosconfigs API |
| 59 | +type TalosConfig struct { |
| 60 | + metav1.TypeMeta `json:",inline"` |
| 61 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 62 | + |
| 63 | + Spec TalosConfigSpec `json:"spec,omitempty"` |
| 64 | + Status TalosConfigStatus `json:"status,omitempty"` |
| 65 | +} |
| 66 | + |
| 67 | +// +kubebuilder:object:root=true |
| 68 | + |
| 69 | +// TalosConfigList contains a list of TalosConfig |
| 70 | +type TalosConfigList struct { |
| 71 | + metav1.TypeMeta `json:",inline"` |
| 72 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 73 | + Items []TalosConfig `json:"items"` |
| 74 | +} |
| 75 | + |
| 76 | +func init() { |
| 77 | + SchemeBuilder.Register(&TalosConfig{}, &TalosConfigList{}) |
| 78 | +} |
0 commit comments