Skip to content

Commit 17400af

Browse files
committed
Rename MHC unhealthyConditions to unhealthyNodeConditions
Signed-off-by: Stefan Büringer buringerst@vmware.com
1 parent 071d769 commit 17400af

33 files changed

+321
-318
lines changed

api/v1beta1/conversion.go

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,42 @@ func Convert_v1beta1_ClusterClassSpec_To_v1beta2_ClusterClassSpec(in *ClusterCla
132132
return nil
133133
}
134134

135+
func Convert_v1beta1_MachineHealthCheckClass_To_v1beta2_MachineHealthCheckClass(in *MachineHealthCheckClass, out *clusterv1.MachineHealthCheckClass, s apimachineryconversion.Scope) error {
136+
if err := autoConvert_v1beta1_MachineHealthCheckClass_To_v1beta2_MachineHealthCheckClass(in, out, s); err != nil {
137+
return err
138+
}
139+
140+
if len(in.UnhealthyConditions) > 0 {
141+
for _, c := range in.UnhealthyConditions {
142+
out.UnhealthyNodeConditions = append(out.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{
143+
Type: c.Type,
144+
Status: c.Status,
145+
Timeout: c.Timeout,
146+
})
147+
}
148+
}
149+
150+
return nil
151+
}
152+
153+
func Convert_v1beta2_MachineHealthCheckClass_To_v1beta1_MachineHealthCheckClass(in *clusterv1.MachineHealthCheckClass, out *MachineHealthCheckClass, s apimachineryconversion.Scope) error {
154+
if err := autoConvert_v1beta2_MachineHealthCheckClass_To_v1beta1_MachineHealthCheckClass(in, out, s); err != nil {
155+
return err
156+
}
157+
158+
if len(in.UnhealthyNodeConditions) > 0 {
159+
for _, c := range in.UnhealthyNodeConditions {
160+
out.UnhealthyConditions = append(out.UnhealthyConditions, UnhealthyCondition{
161+
Type: c.Type,
162+
Status: c.Status,
163+
Timeout: c.Timeout,
164+
})
165+
}
166+
}
167+
168+
return nil
169+
}
170+
135171
func Convert_v1beta1_LocalObjectTemplate_To_v1beta2_InfrastructureClass(in *LocalObjectTemplate, out *clusterv1.InfrastructureClass, s apimachineryconversion.Scope) error {
136172
if in == nil {
137173
return nil
@@ -383,6 +419,42 @@ func Convert_v1beta1_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(
383419
return nil
384420
}
385421

422+
func Convert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *clusterv1.MachineHealthCheckSpec, s apimachineryconversion.Scope) error {
423+
if err := autoConvert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(in, out, s); err != nil {
424+
return err
425+
}
426+
427+
if len(in.UnhealthyConditions) > 0 {
428+
for _, c := range in.UnhealthyConditions {
429+
out.UnhealthyNodeConditions = append(out.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{
430+
Type: c.Type,
431+
Status: c.Status,
432+
Timeout: c.Timeout,
433+
})
434+
}
435+
}
436+
437+
return nil
438+
}
439+
440+
func Convert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *clusterv1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s apimachineryconversion.Scope) error {
441+
if err := autoConvert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in, out, s); err != nil {
442+
return err
443+
}
444+
445+
if len(in.UnhealthyNodeConditions) > 0 {
446+
for _, c := range in.UnhealthyNodeConditions {
447+
out.UnhealthyConditions = append(out.UnhealthyConditions, UnhealthyCondition{
448+
Type: c.Type,
449+
Status: c.Status,
450+
Timeout: c.Timeout,
451+
})
452+
}
453+
}
454+
455+
return nil
456+
}
457+
386458
func Convert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *clusterv1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s apimachineryconversion.Scope) error {
387459
if err := autoConvert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in, out, s); err != nil {
388460
return err

api/v1beta1/zz_generated.conversion.go

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

api/v1beta2/clusterclass_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,13 @@ type MachineDeploymentClassNamingStrategy struct {
376376

377377
// MachineHealthCheckClass defines a MachineHealthCheck for a group of Machines.
378378
type MachineHealthCheckClass struct {
379-
// unhealthyConditions contains a list of the conditions that determine
379+
// unhealthyNodeConditions contains a list of conditions that determine
380380
// whether a node is considered unhealthy. The conditions are combined in a
381381
// logical OR, i.e. if any of the conditions is met, the node is unhealthy.
382382
//
383383
// +optional
384384
// +kubebuilder:validation:MaxItems=100
385-
UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions,omitempty"`
385+
UnhealthyNodeConditions []UnhealthyNodeCondition `json:"unhealthyNodeConditions,omitempty"`
386386

387387
// maxUnhealthy specifies the maximum number of unhealthy machines allowed.
388388
// Any further remediation is only allowed if at most "maxUnhealthy" machines selected by

api/v1beta2/machinehealthcheck_types.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ type MachineHealthCheckSpec struct {
6161
// +required
6262
Selector metav1.LabelSelector `json:"selector"`
6363

64-
// unhealthyConditions contains a list of the conditions that determine
65-
// whether a node is considered unhealthy. The conditions are combined in a
64+
// unhealthyNodeConditions contains a list of conditions that determine
65+
// whether a node is considered unhealthy. The conditions are combined in a
6666
// logical OR, i.e. if any of the conditions is met, the node is unhealthy.
6767
//
6868
// +optional
6969
// +kubebuilder:validation:MaxItems=100
70-
UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions,omitempty"`
70+
UnhealthyNodeConditions []UnhealthyNodeCondition `json:"unhealthyNodeConditions,omitempty"`
7171

7272
// maxUnhealthy specifies the maximum number of unhealthy machines allowed.
7373
// Any further remediation is only allowed if at most "maxUnhealthy" machines selected by
@@ -120,12 +120,12 @@ type MachineHealthCheckSpec struct {
120120

121121
// ANCHOR_END: MachineHealthCHeckSpec
122122

123-
// ANCHOR: UnhealthyCondition
123+
// ANCHOR: UnhealthyNodeCondition
124124

125-
// UnhealthyCondition represents a Node condition type and value with a timeout
125+
// UnhealthyNodeCondition represents a Node condition type and value with a timeout
126126
// specified as a duration. When the named condition has been in the given
127127
// status for at least the timeout value, a node is considered unhealthy.
128-
type UnhealthyCondition struct {
128+
type UnhealthyNodeCondition struct {
129129
// type of Node condition
130130
// +kubebuilder:validation:Type=string
131131
// +kubebuilder:validation:MinLength=1
@@ -146,7 +146,7 @@ type UnhealthyCondition struct {
146146
Timeout metav1.Duration `json:"timeout"`
147147
}
148148

149-
// ANCHOR_END: UnhealthyCondition
149+
// ANCHOR_END: UnhealthyNodeCondition
150150

151151
// ANCHOR: MachineHealthCheckStatus
152152

api/v1beta2/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)