Skip to content

Commit 7552a39

Browse files
committed
[api] add maintenance spec and evicted status field as discussed
This adds the maintenance spec prop and evicted bool status which was discussed in the the workshop
1 parent 5d77f36 commit 7552a39

5 files changed

Lines changed: 50 additions & 0 deletions

File tree

api/v1/hypervisor_types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ type HypervisorSpec struct {
7474
// +kubebuilder:default:=true
7575
// InstallCertificate is used to enable the installations of the certificates via kvm-node-agent.
7676
InstallCertificate bool `json:"installCertificate"`
77+
78+
// +kubebuilder:optional
79+
// +kubebuilder:validation:Enum:=;manual;auto;ha
80+
// Maintenance indicates whether the hypervisor is in maintenance mode.
81+
Maintenance string `json:"maintenance,omitempty"`
7782
}
7883

7984
type Instance struct {
@@ -184,6 +189,9 @@ type HypervisorStatus struct {
184189
// InternalIP is the internal IP address of the hypervisor.
185190
InternalIP string `json:"internalIp,omitempty"`
186191

192+
// Evicted indicates whether the hypervisor is evicted. (no instances left with active maintenance mode)
193+
Evicted bool `json:"evicted,omitempty"`
194+
187195
// Represents the Hypervisor node conditions.
188196
Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"`
189197

applyconfigurations/api/v1/hypervisorspec.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfigurations/api/v1/hypervisorstatus.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/openstack-hypervisor-operator/crds/hypervisor-crd.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ spec:
138138
description: LifecycleEnabled enables the lifecycle management of
139139
the hypervisor via hypervisor-operator.
140140
type: boolean
141+
maintenance:
142+
description: Maintenance indicates whether the hypervisor is in maintenance
143+
mode.
144+
enum:
145+
- ;manual
146+
- auto
147+
- ha
148+
type: string
141149
reboot:
142150
default: false
143151
description: Reboot request an reboot after successful installation
@@ -251,6 +259,10 @@ spec:
251259
- type
252260
type: object
253261
type: array
262+
evicted:
263+
description: Evicted indicates whether the hypervisor is evicted.
264+
(no instances left with active maintenance mode)
265+
type: boolean
254266
hypervisorId:
255267
description: HypervisorID is the unique identifier of the hypervisor
256268
in OpenStack.

config/crd/bases/kvm.cloud.sap_hypervisors.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ spec:
139139
description: LifecycleEnabled enables the lifecycle management of
140140
the hypervisor via hypervisor-operator.
141141
type: boolean
142+
maintenance:
143+
description: Maintenance indicates whether the hypervisor is in maintenance
144+
mode.
145+
enum:
146+
- ;manual
147+
- auto
148+
- ha
149+
type: string
142150
reboot:
143151
default: false
144152
description: Reboot request an reboot after successful installation
@@ -252,6 +260,10 @@ spec:
252260
- type
253261
type: object
254262
type: array
263+
evicted:
264+
description: Evicted indicates whether the hypervisor is evicted.
265+
(no instances left with active maintenance mode)
266+
type: boolean
255267
hypervisorId:
256268
description: HypervisorID is the unique identifier of the hypervisor
257269
in OpenStack.

0 commit comments

Comments
 (0)