Skip to content

Commit 52d9308

Browse files
Kubebuilder annotations
1 parent d99e352 commit 52d9308

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

api/v1/hypervisor_types.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,20 @@ type Capabilities struct {
210210
// Domain capabilities of the hypervisor as reported by libvirt.
211211
// These details are relevant to check if a VM can be scheduled on the hypervisor.
212212
type DomainCapabilities struct {
213-
// +kubebuilder:default:=unknown
214213
// The available domain cpu architecture.
215-
Arch string `json:"arch,omitempty"`
216214
// +kubebuilder:default:=unknown
215+
Arch string `json:"arch,omitempty"`
217216
// The supported type of virtualization for domains, such as "ch".
217+
// +kubebuilder:default:=unknown
218218
HypervisorType string `json:"hypervisorType,omitempty"`
219-
// +kubebuilder:default:={}
220219
// Supported devices for domains, such as "video".
221-
SupportedDevices []string `json:"supportedDevices,omitempty"`
222220
// +kubebuilder:default:={}
221+
SupportedDevices []string `json:"supportedDevices,omitempty"`
223222
// Supported cpu modes for domains, such as "host-passthrough".
224-
SupportedCpuModes []string `json:"supportedCpuModes,omitempty"`
225223
// +kubebuilder:default:={}
224+
SupportedCpuModes []string `json:"supportedCpuModes,omitempty"`
226225
// Supported features for domains, such as "sev" or "sgx".
226+
// +kubebuilder:default:={}
227227
SupportedFeatures []string `json:"supportedFeatures,omitempty"`
228228
}
229229

@@ -243,21 +243,23 @@ type HypervisorStatus struct {
243243
Instances []Instance `json:"instances,omitempty"`
244244

245245
// Auto-discovered capabilities as reported by libvirt.
246+
// +kubebuilder:validation:Optional
246247
Capabilities Capabilities `json:"capabilities"`
247248

248249
// Auto-discovered domain capabilities relevant to check if a VM
249250
// can be scheduled on the hypervisor.
251+
// +kubebuilder:validation:Optional
250252
DomainCapabilities DomainCapabilities `json:"domainCapabilities"`
251253

252-
// +kubebuilder:default:={}
253254
// Auto-discovered capacity available in total on the hypervisor.
254255
// The remaining physical capacity can be calculated
255256
// as Capacity - Allocation.
257+
// +kubebuilder:default:={}
256258
Capacity map[string]resource.Quantity `json:"capacity,omitempty"`
257259

258-
// +kubebuilder:default:={}
259260
// Auto-discovered capacity currently allocated by instances
260261
// on the hypervisor. Note that this does not include reserved capacity.
262+
// +kubebuilder:default:={}
261263
Allocation map[string]resource.Quantity `json:"allocation,omitempty"`
262264

263265
// +kubebuilder:default:=0

0 commit comments

Comments
 (0)