Skip to content

Commit d9033b3

Browse files
authored
Merge pull request #12245 from sbueringer/pr-rename-mhc-nodeconditions
⚠️ Rename MHC unhealthyConditions to unhealthyNodeConditions
2 parents 72b19b1 + 7fa6fee commit d9033b3

33 files changed

+434
-363
lines changed

api/v1beta1/conversion.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,38 @@ 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+
for _, c := range in.UnhealthyConditions {
141+
out.UnhealthyNodeConditions = append(out.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{
142+
Type: c.Type,
143+
Status: c.Status,
144+
Timeout: c.Timeout,
145+
})
146+
}
147+
148+
return nil
149+
}
150+
151+
func Convert_v1beta2_MachineHealthCheckClass_To_v1beta1_MachineHealthCheckClass(in *clusterv1.MachineHealthCheckClass, out *MachineHealthCheckClass, s apimachineryconversion.Scope) error {
152+
if err := autoConvert_v1beta2_MachineHealthCheckClass_To_v1beta1_MachineHealthCheckClass(in, out, s); err != nil {
153+
return err
154+
}
155+
156+
for _, c := range in.UnhealthyNodeConditions {
157+
out.UnhealthyConditions = append(out.UnhealthyConditions, UnhealthyCondition{
158+
Type: c.Type,
159+
Status: c.Status,
160+
Timeout: c.Timeout,
161+
})
162+
}
163+
164+
return nil
165+
}
166+
135167
func Convert_v1beta1_LocalObjectTemplate_To_v1beta2_InfrastructureClass(in *LocalObjectTemplate, out *clusterv1.InfrastructureClass, s apimachineryconversion.Scope) error {
136168
if in == nil {
137169
return nil
@@ -403,6 +435,38 @@ func Convert_v1beta1_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(
403435
return nil
404436
}
405437

438+
func Convert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *clusterv1.MachineHealthCheckSpec, s apimachineryconversion.Scope) error {
439+
if err := autoConvert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(in, out, s); err != nil {
440+
return err
441+
}
442+
443+
for _, c := range in.UnhealthyConditions {
444+
out.UnhealthyNodeConditions = append(out.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{
445+
Type: c.Type,
446+
Status: c.Status,
447+
Timeout: c.Timeout,
448+
})
449+
}
450+
451+
return nil
452+
}
453+
454+
func Convert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *clusterv1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s apimachineryconversion.Scope) error {
455+
if err := autoConvert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in, out, s); err != nil {
456+
return err
457+
}
458+
459+
for _, c := range in.UnhealthyNodeConditions {
460+
out.UnhealthyConditions = append(out.UnhealthyConditions, UnhealthyCondition{
461+
Type: c.Type,
462+
Status: c.Status,
463+
Timeout: c.Timeout,
464+
})
465+
}
466+
467+
return nil
468+
}
469+
406470
func Convert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *clusterv1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s apimachineryconversion.Scope) error {
407471
if err := autoConvert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in, out, s); err != nil {
408472
return err

api/v1beta1/zz_generated.conversion.go

Lines changed: 118 additions & 88 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.

api/v1beta2/zz_generated.openapi.go

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

config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml

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

0 commit comments

Comments
 (0)