Skip to content

Commit e682fd8

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 8c9a145 commit e682fd8

File tree

5 files changed

+52
-0
lines changed

5 files changed

+52
-0
lines changed

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: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ 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+
- ""
146+
- manual
147+
- auto
148+
- ha
149+
type: string
141150
reboot:
142151
default: false
143152
description: Reboot request an reboot after successful installation
@@ -251,6 +260,10 @@ spec:
251260
- type
252261
type: object
253262
type: array
263+
evicted:
264+
description: Evicted indicates whether the hypervisor is evicted.
265+
(no instances left with active maintenance mode)
266+
type: boolean
254267
hypervisorId:
255268
description: HypervisorID is the unique identifier of the hypervisor
256269
in OpenStack.

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ 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+
- ""
147+
- manual
148+
- auto
149+
- ha
150+
type: string
142151
reboot:
143152
default: false
144153
description: Reboot request an reboot after successful installation
@@ -252,6 +261,10 @@ spec:
252261
- type
253262
type: object
254263
type: array
264+
evicted:
265+
description: Evicted indicates whether the hypervisor is evicted.
266+
(no instances left with active maintenance mode)
267+
type: boolean
255268
hypervisorId:
256269
description: HypervisorID is the unique identifier of the hypervisor
257270
in OpenStack.

0 commit comments

Comments
 (0)