@@ -57,7 +57,7 @@ func TestIsControlPlaneMachineHealthCheckEnabled(t *testing.T) {
57
57
want : false ,
58
58
},
59
59
{
60
- name : "should return true if MachineHealthCheck if defined in ClusterClass, not defined in cluster topology and enable is not set" ,
60
+ name : "should return true if MachineHealthCheck is defined in ClusterClass, not defined in cluster topology and enable is not set" ,
61
61
blueprint : & ClusterBlueprint {
62
62
ClusterClass : builder .ClusterClass (metav1 .NamespaceDefault , "cluster-class" ).
63
63
WithControlPlaneInfrastructureMachineTemplate (& unstructured.Unstructured {}).
@@ -80,11 +80,21 @@ func TestIsControlPlaneMachineHealthCheckEnabled(t *testing.T) {
80
80
want : true ,
81
81
},
82
82
{
83
- name : "should return false if MachineHealthCheck if defined in ClusterClass, not defined in cluster topology and enable is false" ,
83
+ name : "should return false if MachineHealthCheck is defined in ClusterClass, not defined in cluster topology and enable is false" ,
84
84
blueprint : & ClusterBlueprint {
85
85
ClusterClass : builder .ClusterClass (metav1 .NamespaceDefault , "cluster-class" ).
86
86
WithControlPlaneInfrastructureMachineTemplate (& unstructured.Unstructured {}).
87
- WithControlPlaneMachineHealthCheck (clusterv1.ControlPlaneClassHealthCheck {}).
87
+ WithControlPlaneMachineHealthCheck (clusterv1.ControlPlaneClassHealthCheck {
88
+ Checks : clusterv1.ControlPlaneClassHealthCheckChecks {
89
+ UnhealthyNodeConditions : []clusterv1.UnhealthyNodeCondition {
90
+ {
91
+ Type : corev1 .NodeReady ,
92
+ Status : corev1 .ConditionUnknown ,
93
+ TimeoutSeconds : 5 * 60 ,
94
+ },
95
+ },
96
+ },
97
+ }).
88
98
Build (),
89
99
Topology : builder .ClusterTopology ().
90
100
WithClass ("cluster-class" ).
@@ -96,7 +106,7 @@ func TestIsControlPlaneMachineHealthCheckEnabled(t *testing.T) {
96
106
want : false ,
97
107
},
98
108
{
99
- name : "should return true if MachineHealthCheck if defined in ClusterClass, not defined in cluster topology and enable is true" ,
109
+ name : "should return true if MachineHealthCheck is defined in ClusterClass, not defined in cluster topology and enable is true" ,
100
110
blueprint : & ClusterBlueprint {
101
111
ClusterClass : builder .ClusterClass (metav1 .NamespaceDefault , "cluster-class" ).
102
112
WithControlPlaneInfrastructureMachineTemplate (& unstructured.Unstructured {}).
@@ -122,7 +132,7 @@ func TestIsControlPlaneMachineHealthCheckEnabled(t *testing.T) {
122
132
want : true ,
123
133
},
124
134
{
125
- name : "should return true if MachineHealthCheck if defined in cluster topology, not defined in ClusterClass and enable is not set" ,
135
+ name : "should return true if MachineHealthCheck is defined in cluster topology, not defined in ClusterClass and enable is not set" ,
126
136
blueprint : & ClusterBlueprint {
127
137
ClusterClass : builder .ClusterClass (metav1 .NamespaceDefault , "cluster-class" ).
128
138
WithControlPlaneInfrastructureMachineTemplate (& unstructured.Unstructured {}).
@@ -145,7 +155,7 @@ func TestIsControlPlaneMachineHealthCheckEnabled(t *testing.T) {
145
155
want : true ,
146
156
},
147
157
{
148
- name : "should return false if MachineHealthCheck if defined in cluster topology, not defined in ClusterClass and enable is false" ,
158
+ name : "should return false if MachineHealthCheck is defined in cluster topology, not defined in ClusterClass and enable is false" ,
149
159
blueprint : & ClusterBlueprint {
150
160
ClusterClass : builder .ClusterClass (metav1 .NamespaceDefault , "cluster-class" ).
151
161
WithControlPlaneInfrastructureMachineTemplate (& unstructured.Unstructured {}).
@@ -169,7 +179,7 @@ func TestIsControlPlaneMachineHealthCheckEnabled(t *testing.T) {
169
179
want : false ,
170
180
},
171
181
{
172
- name : "should return true if MachineHealthCheck if defined in cluster topology, not defined in ClusterClass and enable is true" ,
182
+ name : "should return true if MachineHealthCheck is defined in cluster topology, not defined in ClusterClass and enable is true" ,
173
183
blueprint : & ClusterBlueprint {
174
184
ClusterClass : builder .ClusterClass (metav1 .NamespaceDefault , "cluster-class" ).
175
185
WithControlPlaneInfrastructureMachineTemplate (& unstructured.Unstructured {}).
@@ -350,7 +360,17 @@ func TestIsMachineDeploymentMachineHealthCheckEnabled(t *testing.T) {
350
360
blueprint : & ClusterBlueprint {
351
361
MachineDeployments : map [string ]* MachineDeploymentBlueprint {
352
362
"worker-class" : {
353
- HealthCheck : clusterv1.MachineDeploymentClassHealthCheck {},
363
+ HealthCheck : clusterv1.MachineDeploymentClassHealthCheck {
364
+ Checks : clusterv1.MachineDeploymentClassHealthCheckChecks {
365
+ UnhealthyNodeConditions : []clusterv1.UnhealthyNodeCondition {
366
+ {
367
+ Type : corev1 .NodeReady ,
368
+ Status : corev1 .ConditionUnknown ,
369
+ TimeoutSeconds : 5 * 60 ,
370
+ },
371
+ },
372
+ },
373
+ },
354
374
},
355
375
},
356
376
},
0 commit comments