@@ -45,35 +45,28 @@ type TinkerbellMachineSpec struct {
45
45
// kubernetes/release: v1.13.0, v1.12.5-mybuild.1, or v1.17.3. For example, the default
46
46
// image format of {{.BaseRegistry}}/{{.OSDistro}}-{{.OSVersion}}:{{.KubernetesVersion}}.gz will
47
47
// attempt to pull the image from that location. See also: https://golang.org/pkg/text/template/
48
- // +optional
49
48
ImageLookupFormat string `json:"imageLookupFormat,omitempty"`
50
49
51
50
// ImageLookupBaseRegistry is the base Registry URL that is used for pulling images,
52
51
// if not set, the default will be to use ghcr.io/tinkerbell/cluster-api-provider-tinkerbell.
53
- // +optional
54
52
ImageLookupBaseRegistry string `json:"imageLookupBaseRegistry,omitempty"`
55
53
56
54
// ImageLookupOSDistro is the name of the OS distro to use when fetching machine images,
57
55
// if not set it will default to ubuntu.
58
- // +optional
59
56
ImageLookupOSDistro string `json:"imageLookupOSDistro,omitempty"`
60
57
61
58
// ImageLookupOSVersion is the version of the OS distribution to use when fetching machine
62
59
// images. If not set it will default based on ImageLookupOSDistro.
63
- // +optional
64
60
ImageLookupOSVersion string `json:"imageLookupOSVersion,omitempty"`
65
61
66
62
// TemplateOverride overrides the default Tinkerbell template used by CAPT.
67
63
// You can learn more about Tinkerbell templates here: https://tinkerbell.org/docs/concepts/templates/
68
- // +optional
69
64
TemplateOverride string `json:"templateOverride,omitempty"`
70
65
71
66
// HardwareAffinity allows filtering for hardware.
72
- // +optional
73
67
HardwareAffinity * HardwareAffinity `json:"hardwareAffinity,omitempty"`
74
68
75
69
// BootOptions are options that control the booting of Hardware.
76
- // +optional
77
70
BootOptions BootOptions `json:"bootOptions,omitempty"`
78
71
79
72
// Those fields are set programmatically, but they cannot be re-constructed from "state of the world", so
@@ -95,26 +88,20 @@ type BootOptions struct {
95
88
// as this is where the ISO patching endpoint lives.
96
89
// The ":macAddress" is a placeholder for the MAC address of the hardware and
97
90
// should be provided exactly as is: ":macAddress".
98
- // +optional
99
- // +kubebuilder:validation:Format=url
100
91
ISOURL string `json:"isoURL,omitempty"`
101
92
102
93
// BootMode is the type of booting that will be done.
103
94
// Must be one of "none", "netboot", or "iso".
104
- // +optional
105
- // +kubebuilder:validation:Enum=none;netboot;iso
106
95
BootMode BootMode `json:"bootMode,omitempty"`
107
96
}
108
97
109
98
// HardwareAffinity defines the required and preferred hardware affinities.
110
99
type HardwareAffinity struct {
111
100
// Required are the required hardware affinity terms. The terms are OR'd together, hardware must match one term to
112
101
// be considered.
113
- // +optional
114
102
Required []HardwareAffinityTerm `json:"required,omitempty"`
115
103
// Preferred are the preferred hardware affinity terms. Hardware matching these terms are preferred according to the
116
104
// weights provided, but are not required.
117
- // +optional
118
105
Preferred []WeightedHardwareAffinityTerm `json:"preferred,omitempty"`
119
106
}
120
107
@@ -128,8 +115,6 @@ type HardwareAffinityTerm struct {
128
115
// WeightedHardwareAffinityTerm fields are added per-hardware to find the most preferred hardware.
129
116
type WeightedHardwareAffinityTerm struct {
130
117
// Weight associated with matching the corresponding hardwareAffinityTerm, in the range 1-100.
131
- // +kubebuilder:validation:Minimum=1
132
- // +kubebuilder:validation:Maximum=100
133
118
Weight int32 `json:"weight"`
134
119
// HardwareAffinityTerm is the term associated with the corresponding weight.
135
120
HardwareAffinityTerm HardwareAffinityTerm `json:"hardwareAffinityTerm"`
@@ -141,20 +126,17 @@ type TinkerbellMachineStatus struct {
141
126
// Important: Run "make" to regenerate code after modifying this file
142
127
143
128
// Ready is true when the provider resource is ready.
144
- // +optional
145
129
Ready bool `json:"ready"`
146
130
147
131
// Addresses contains the Tinkerbell device associated addresses.
148
132
Addresses []corev1.NodeAddress `json:"addresses,omitempty"`
149
133
150
134
// InstanceStatus is the status of the Tinkerbell device instance for this machine.
151
- // +optional
152
135
InstanceStatus * TinkerbellResourceStatus `json:"instanceStatus,omitempty"`
153
136
154
137
// Any transient errors that occur during the reconciliation of Machines
155
138
// can be added as events to the Machine object and/or logged in the
156
139
// controller's output.
157
- // +optional
158
140
ErrorReason * capierrors.MachineStatusError `json:"errorReason,omitempty"`
159
141
160
142
// ErrorMessage will be set in the event that there is a terminal problem
@@ -173,20 +155,9 @@ type TinkerbellMachineStatus struct {
173
155
// Any transient errors that occur during the reconciliation of Machines
174
156
// can be added as events to the Machine object and/or logged in the
175
157
// controller's output.
176
- // +optional
177
158
ErrorMessage * string `json:"errorMessage,omitempty"`
178
159
}
179
160
180
- // +kubebuilder:subresource:status
181
- // +kubebuilder:object:root=true
182
- // +kubebuilder:resource:path=tinkerbellmachines,scope=Namespaced,categories=cluster-api
183
- // +kubebuilder:storageversion
184
- // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this TinkerbellMachine belongs"
185
- // +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="Tinkerbell instance state"
186
- // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status"
187
- // +kubebuilder:printcolumn:name="InstanceID",type="string",JSONPath=".spec.providerID",description="Tinkerbell instance ID"
188
- // +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this TinkerbellMachine"
189
-
190
161
// TinkerbellMachine is the Schema for the tinkerbellmachines API.
191
162
type TinkerbellMachine struct {
192
163
metav1.TypeMeta `json:",inline"`
@@ -196,8 +167,6 @@ type TinkerbellMachine struct {
196
167
Status TinkerbellMachineStatus `json:"status,omitempty"`
197
168
}
198
169
199
- // +kubebuilder:object:root=true
200
-
201
170
// TinkerbellMachineList contains a list of TinkerbellMachine.
202
171
type TinkerbellMachineList struct {
203
172
metav1.TypeMeta `json:",inline"`
0 commit comments