@@ -677,7 +677,6 @@ func Convert_v1beta1_ControlPlaneClass_To_v1beta2_ControlPlaneClass(in *ControlP
677
677
convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference (& in .LocalObjectTemplate , & out .TemplateRef , s )
678
678
679
679
if in .MachineHealthCheck != nil {
680
- out .HealthCheck = & clusterv1.ControlPlaneClassHealthCheck {}
681
680
for _ , c := range in .MachineHealthCheck .UnhealthyConditions {
682
681
out .HealthCheck .Checks .UnhealthyNodeConditions = append (out .HealthCheck .Checks .UnhealthyNodeConditions , clusterv1.UnhealthyNodeCondition {
683
682
Type : c .Type ,
@@ -712,7 +711,7 @@ func Convert_v1beta2_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *clusterv
712
711
out .NodeDeletionTimeout = clusterv1 .ConvertFromSeconds (in .Deletion .NodeDeletionTimeoutSeconds )
713
712
Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate (& in .TemplateRef , & out .LocalObjectTemplate , s )
714
713
715
- if in .HealthCheck != nil {
714
+ if ! reflect . DeepEqual ( in .HealthCheck , clusterv1. ControlPlaneClassHealthCheck {}) {
716
715
out .MachineHealthCheck = & MachineHealthCheckClass {}
717
716
for _ , c := range in .HealthCheck .Checks .UnhealthyNodeConditions {
718
717
out .MachineHealthCheck .UnhealthyConditions = append (out .MachineHealthCheck .UnhealthyConditions , UnhealthyCondition {
@@ -755,7 +754,6 @@ func Convert_v1beta1_ControlPlaneTopology_To_v1beta2_ControlPlaneTopology(in *Co
755
754
out .Deletion .NodeDeletionTimeoutSeconds = clusterv1 .ConvertToSeconds (in .NodeDeletionTimeout )
756
755
757
756
if in .MachineHealthCheck != nil {
758
- out .HealthCheck = & clusterv1.ControlPlaneTopologyHealthCheck {}
759
757
out .HealthCheck .Enabled = in .MachineHealthCheck .Enable
760
758
for _ , c := range in .MachineHealthCheck .UnhealthyConditions {
761
759
out .HealthCheck .Checks .UnhealthyNodeConditions = append (out .HealthCheck .Checks .UnhealthyNodeConditions , clusterv1.UnhealthyNodeCondition {
@@ -791,7 +789,7 @@ func Convert_v1beta2_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *cl
791
789
out .NodeVolumeDetachTimeout = clusterv1 .ConvertFromSeconds (in .Deletion .NodeVolumeDetachTimeoutSeconds )
792
790
out .NodeDeletionTimeout = clusterv1 .ConvertFromSeconds (in .Deletion .NodeDeletionTimeoutSeconds )
793
791
794
- if in .HealthCheck != nil {
792
+ if ! reflect . DeepEqual ( in .HealthCheck , clusterv1. ControlPlaneTopologyHealthCheck {}) {
795
793
out .MachineHealthCheck = & MachineHealthCheckTopology {}
796
794
out .MachineHealthCheck .Enable = in .HealthCheck .Enabled
797
795
for _ , c := range in .HealthCheck .Checks .UnhealthyNodeConditions {
@@ -839,9 +837,6 @@ func Convert_v1beta1_MachineDeploymentClass_To_v1beta2_MachineDeploymentClass(in
839
837
}
840
838
}
841
839
if in .Strategy .Remediation != nil && in .Strategy .Remediation .MaxInFlight != nil {
842
- if out .HealthCheck == nil {
843
- out .HealthCheck = & clusterv1.MachineDeploymentClassHealthCheck {}
844
- }
845
840
out .HealthCheck .Remediation .MaxInFlight = in .Strategy .Remediation .MaxInFlight
846
841
}
847
842
}
@@ -850,9 +845,6 @@ func Convert_v1beta1_MachineDeploymentClass_To_v1beta2_MachineDeploymentClass(in
850
845
out .Deletion .NodeDeletionTimeoutSeconds = clusterv1 .ConvertToSeconds (in .NodeDeletionTimeout )
851
846
852
847
if in .MachineHealthCheck != nil {
853
- if out .HealthCheck == nil {
854
- out .HealthCheck = & clusterv1.MachineDeploymentClassHealthCheck {}
855
- }
856
848
for _ , c := range in .MachineHealthCheck .UnhealthyConditions {
857
849
out .HealthCheck .Checks .UnhealthyNodeConditions = append (out .HealthCheck .Checks .UnhealthyNodeConditions , clusterv1.UnhealthyNodeCondition {
858
850
Type : c .Type ,
@@ -909,7 +901,7 @@ func Convert_v1beta2_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in
909
901
}
910
902
out .Strategy .RollingUpdate .DeletePolicy = ptr .To (string (in .Deletion .Order ))
911
903
}
912
- if in .HealthCheck != nil && in . HealthCheck .Remediation .MaxInFlight != nil {
904
+ if in .HealthCheck .Remediation .MaxInFlight != nil {
913
905
if out .Strategy == nil {
914
906
out .Strategy = & MachineDeploymentStrategy {}
915
907
}
@@ -923,7 +915,7 @@ func Convert_v1beta2_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in
923
915
out .NodeDeletionTimeout = clusterv1 .ConvertFromSeconds (in .Deletion .NodeDeletionTimeoutSeconds )
924
916
925
917
// Check if HealthCheck is not nil and another field apart from MaxInFlight is set (MaxInFlight is set in Strategy above).
926
- if in . HealthCheck != nil && ! reflect .DeepEqual (in .HealthCheck , & clusterv1.MachineDeploymentClassHealthCheck {
918
+ if ! reflect .DeepEqual (in .HealthCheck , clusterv1.MachineDeploymentClassHealthCheck {
927
919
Remediation : clusterv1.MachineDeploymentClassHealthCheckRemediation {MaxInFlight : in .HealthCheck .Remediation .MaxInFlight },
928
920
}) {
929
921
out .MachineHealthCheck = & MachineHealthCheckClass {}
@@ -973,9 +965,6 @@ func Convert_v1beta1_MachineDeploymentTopology_To_v1beta2_MachineDeploymentTopol
973
965
}
974
966
}
975
967
if in .Strategy .Remediation != nil && in .Strategy .Remediation .MaxInFlight != nil {
976
- if out .HealthCheck == nil {
977
- out .HealthCheck = & clusterv1.MachineDeploymentTopologyHealthCheck {}
978
- }
979
968
out .HealthCheck .Remediation .MaxInFlight = in .Strategy .Remediation .MaxInFlight
980
969
}
981
970
}
@@ -984,9 +973,6 @@ func Convert_v1beta1_MachineDeploymentTopology_To_v1beta2_MachineDeploymentTopol
984
973
out .Deletion .NodeDeletionTimeoutSeconds = clusterv1 .ConvertToSeconds (in .NodeDeletionTimeout )
985
974
986
975
if in .MachineHealthCheck != nil {
987
- if out .HealthCheck == nil {
988
- out .HealthCheck = & clusterv1.MachineDeploymentTopologyHealthCheck {}
989
- }
990
976
out .HealthCheck .Enabled = in .MachineHealthCheck .Enable
991
977
for _ , c := range in .MachineHealthCheck .UnhealthyConditions {
992
978
out .HealthCheck .Checks .UnhealthyNodeConditions = append (out .HealthCheck .Checks .UnhealthyNodeConditions , clusterv1.UnhealthyNodeCondition {
@@ -1036,7 +1022,7 @@ func Convert_v1beta2_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopol
1036
1022
}
1037
1023
out .Strategy .RollingUpdate .DeletePolicy = ptr .To (string (in .Deletion .Order ))
1038
1024
}
1039
- if in .HealthCheck != nil && in . HealthCheck .Remediation .MaxInFlight != nil {
1025
+ if in .HealthCheck .Remediation .MaxInFlight != nil {
1040
1026
if out .Strategy == nil {
1041
1027
out .Strategy = & MachineDeploymentStrategy {}
1042
1028
}
@@ -1050,7 +1036,7 @@ func Convert_v1beta2_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopol
1050
1036
out .NodeDeletionTimeout = clusterv1 .ConvertFromSeconds (in .Deletion .NodeDeletionTimeoutSeconds )
1051
1037
1052
1038
// Check if HealthCheck is not nil and another field apart from MaxInFlight is set (MaxInFlight is set in Strategy above).
1053
- if in . HealthCheck != nil && ! reflect .DeepEqual (in .HealthCheck , & clusterv1.MachineDeploymentTopologyHealthCheck {
1039
+ if ! reflect .DeepEqual (in .HealthCheck , clusterv1.MachineDeploymentTopologyHealthCheck {
1054
1040
Remediation : clusterv1.MachineDeploymentTopologyHealthCheckRemediation {MaxInFlight : in .HealthCheck .Remediation .MaxInFlight },
1055
1041
}) {
1056
1042
out .MachineHealthCheck = & MachineHealthCheckTopology {}
0 commit comments