Skip to content

Commit d807911

Browse files
Address Stefan comments (conversion)
Signed-off-by: Furkat Gofurov <[email protected]>
1 parent f96b742 commit d807911

File tree

4 files changed

+0
-37
lines changed

4 files changed

+0
-37
lines changed

internal/api/core/v1alpha3/conversion.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,6 @@ func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error {
9898
if err != nil {
9999
return err
100100
}
101-
// Recover unhealthyMachineConditions for control plane and machine deployments
102-
dst.Spec.Topology.ControlPlane.HealthCheck.Checks.UnhealthyMachineConditions = restored.Spec.Topology.ControlPlane.HealthCheck.Checks.UnhealthyMachineConditions
103-
for i, md := range restored.Spec.Topology.Workers.MachineDeployments {
104-
if i < len(dst.Spec.Topology.Workers.MachineDeployments) {
105-
dst.Spec.Topology.Workers.MachineDeployments[i].HealthCheck.Checks.UnhealthyMachineConditions = md.HealthCheck.Checks.UnhealthyMachineConditions
106-
}
107-
}
108101

109102
// Recover intent for bool values converted to *bool.
110103
clusterv1.Convert_bool_To_Pointer_bool(src.Spec.Paused, ok, restored.Spec.Paused, &dst.Spec.Paused)

internal/api/core/v1alpha3/conversion_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ func spokeCluster(in *Cluster, c randfill.Continue) {
417417
func MachineHealthCheckFuzzFunc(_ runtimeserializer.CodecFactory) []interface{} {
418418
return []interface{}{
419419
hubMachineHealthCheckStatus,
420-
hubMachineHealthCheckSpec,
421420
hubUnhealthyNodeCondition,
422421
spokeMachineHealthCheck,
423422
spokeMachineHealthCheckSpec,
@@ -426,15 +425,6 @@ func MachineHealthCheckFuzzFunc(_ runtimeserializer.CodecFactory) []interface{}
426425
}
427426
}
428427

429-
func hubMachineHealthCheckSpec(in *clusterv1.MachineHealthCheckSpec, c randfill.Continue) {
430-
c.FillNoCustom(in)
431-
432-
// Drop UnhealthyMachineConditions as it does not exist in v1alpha3.
433-
if in.Checks.UnhealthyMachineConditions != nil {
434-
in.Checks.UnhealthyMachineConditions = nil
435-
}
436-
}
437-
438428
func hubMachineHealthCheckStatus(in *clusterv1.MachineHealthCheckStatus, c randfill.Continue) {
439429
c.FillNoCustom(in)
440430
// Drop empty structs with only omit empty fields.

internal/api/core/v1alpha4/conversion.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error {
9292
return err
9393
}
9494

95-
dst.Spec.Topology.ControlPlane.HealthCheck.Checks.UnhealthyMachineConditions = restored.Spec.Topology.ControlPlane.HealthCheck.Checks.UnhealthyMachineConditions
96-
for i, md := range restored.Spec.Topology.Workers.MachineDeployments {
97-
dst.Spec.Topology.Workers.MachineDeployments[i].HealthCheck.Checks.UnhealthyMachineConditions = md.HealthCheck.Checks.UnhealthyMachineConditions
98-
}
99-
10095
// Recover intent for bool values converted to *bool.
10196
clusterv1.Convert_bool_To_Pointer_bool(src.Spec.Paused, ok, restored.Spec.Paused, &dst.Spec.Paused)
10297

@@ -242,11 +237,6 @@ func (src *ClusterClass) ConvertTo(dstRaw conversion.Hub) error {
242237
return err
243238
}
244239

245-
dst.Spec.ControlPlane.HealthCheck.Checks.UnhealthyMachineConditions = restored.Spec.ControlPlane.HealthCheck.Checks.UnhealthyMachineConditions
246-
for i, md := range restored.Spec.Workers.MachineDeployments {
247-
dst.Spec.Workers.MachineDeployments[i].HealthCheck.Checks.UnhealthyMachineConditions = md.HealthCheck.Checks.UnhealthyMachineConditions
248-
}
249-
250240
dst.Spec.Patches = restored.Spec.Patches
251241
dst.Spec.Variables = restored.Spec.Variables
252242
dst.Spec.AvailabilityGates = restored.Spec.AvailabilityGates

internal/api/core/v1alpha4/conversion_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ func spokeMachineDeploymentSpec(in *MachineDeploymentSpec, c randfill.Continue)
486486
func MachineHealthCheckFuzzFunc(_ runtimeserializer.CodecFactory) []interface{} {
487487
return []interface{}{
488488
hubMachineHealthCheckStatus,
489-
hubMachineHealthCheckSpec,
490489
hubUnhealthyNodeCondition,
491490
spokeMachineHealthCheck,
492491
spokeMachineHealthCheckSpec,
@@ -495,15 +494,6 @@ func MachineHealthCheckFuzzFunc(_ runtimeserializer.CodecFactory) []interface{}
495494
}
496495
}
497496

498-
func hubMachineHealthCheckSpec(in *clusterv1.MachineHealthCheckSpec, c randfill.Continue) {
499-
c.FillNoCustom(in)
500-
501-
// Drop UnhealthyMachineConditions as it does not exist in v1alpha4.
502-
if in.Checks.UnhealthyMachineConditions != nil {
503-
in.Checks.UnhealthyMachineConditions = nil
504-
}
505-
}
506-
507497
func hubMachineHealthCheckStatus(in *clusterv1.MachineHealthCheckStatus, c randfill.Continue) {
508498
c.FillNoCustom(in)
509499
// Drop empty structs with only omit empty fields.

0 commit comments

Comments
 (0)