diff --git a/api/v1alpha3/machinehealthcheck_types.go b/api/v1alpha3/machinehealthcheck_types.go index 1ec5ae4cf0b2..948abf6c4219 100644 --- a/api/v1alpha3/machinehealthcheck_types.go +++ b/api/v1alpha3/machinehealthcheck_types.go @@ -78,11 +78,11 @@ type UnhealthyCondition struct { type MachineHealthCheckStatus struct { // total number of machines counted by this machine health check // +kubebuilder:validation:Minimum=0 - ExpectedMachines int32 `json:"expectedMachines"` + ExpectedMachines int32 `json:"expectedMachines,omitempty"` // total number of healthy machines counted by this machine health check // +kubebuilder:validation:Minimum=0 - CurrentHealthy int32 `json:"currentHealthy"` + CurrentHealthy int32 `json:"currentHealthy,omitempty"` } // ANCHOR_END: MachineHealthCheckStatus diff --git a/api/v1alpha3/machinehealthcheck_webhook_test.go b/api/v1alpha3/machinehealthcheck_webhook_test.go index e9540204e39a..e838f3a4cf12 100644 --- a/api/v1alpha3/machinehealthcheck_webhook_test.go +++ b/api/v1alpha3/machinehealthcheck_webhook_test.go @@ -31,6 +31,8 @@ func TestMachineHealthCheckDefault(t *testing.T) { mhc.Default() g.Expect(mhc.Spec.MaxUnhealthy.String()).To(Equal("100%")) + g.Expect(mhc.Spec.NodeStartupTimeout).ToNot(BeNil()) + g.Expect(*mhc.Spec.NodeStartupTimeout).To(Equal(metav1.Duration{Duration: 10 * time.Minute})) } func TestMachineHealthCheckLabelSelectorAsSelectorValidation(t *testing.T) { diff --git a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml index 66e9b32e9fab..c5d109640699 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml @@ -162,9 +162,6 @@ spec: format: int32 minimum: 0 type: integer - required: - - currentHealthy - - expectedMachines type: object type: object served: true