@@ -195,13 +195,15 @@ func spokeCluster(in *Cluster, c randfill.Continue) {
195195
196196	dropEmptyStringsCluster (in )
197197
198- 	if  in .Spec .Topology  !=  nil  &&  in .Spec .Topology .Workers  !=  nil  {
199- 		for  _ , md  :=  range  in .Spec .Topology .Workers .MachineDeployments  {
200- 			if  md .Strategy  !=  nil  &&  md .Strategy .RollingUpdate  !=  nil  && 
201- 				md .Strategy .RollingUpdate .DeletePolicy  !=  nil  &&  * md .Strategy .RollingUpdate .DeletePolicy  ==  ""  {
202- 				// &"" Is not a valid value for DeletePolicy as the enum validation enforces an enum value if DeletePolicy is set. 
203- 				md .Strategy .RollingUpdate .DeletePolicy  =  nil 
204- 			}
198+ 	if  in .Spec .ClusterNetwork  !=  nil  {
199+ 		if  in .Spec .ClusterNetwork .Services  !=  nil  &&  reflect .DeepEqual (in .Spec .ClusterNetwork .Services , & NetworkRanges {}) {
200+ 			in .Spec .ClusterNetwork .Services  =  nil 
201+ 		}
202+ 		if  in .Spec .ClusterNetwork .Pods  !=  nil  &&  reflect .DeepEqual (in .Spec .ClusterNetwork .Pods , & NetworkRanges {}) {
203+ 			in .Spec .ClusterNetwork .Pods  =  nil 
204+ 		}
205+ 		if  reflect .DeepEqual (in .Spec .ClusterNetwork , & ClusterNetwork {}) {
206+ 			in .Spec .ClusterNetwork  =  nil 
205207		}
206208	}
207209}
@@ -211,6 +213,10 @@ func spokeClusterTopology(in *Topology, c randfill.Continue) {
211213
212214	// RolloutAfter was unused and has been removed in v1beta2. 
213215	in .RolloutAfter  =  nil 
216+ 
217+ 	if  in .Workers  !=  nil  &&  reflect .DeepEqual (in .Workers , & WorkersTopology {}) {
218+ 		in .Workers  =  nil 
219+ 	}
214220}
215221
216222func  spokeClusterStatus (in  * ClusterStatus , c  randfill.Continue ) {
@@ -326,14 +332,6 @@ func spokeClusterClass(in *ClusterClass, c randfill.Continue) {
326332	in .Namespace  =  "foo" 
327333
328334	dropEmptyStringsClusterClass (in )
329- 
330- 	for  _ , md  :=  range  in .Spec .Workers .MachineDeployments  {
331- 		if  md .Strategy  !=  nil  &&  md .Strategy .RollingUpdate  !=  nil  && 
332- 			md .Strategy .RollingUpdate .DeletePolicy  !=  nil  &&  * md .Strategy .RollingUpdate .DeletePolicy  ==  ""  {
333- 			// &"" Is not a valid value for DeletePolicy as the enum validation enforces an enum value if DeletePolicy is set. 
334- 			md .Strategy .RollingUpdate .DeletePolicy  =  nil 
335- 		}
336- 	}
337335}
338336
339337func  spokeClusterClassStatus (in  * ClusterClassStatus , c  randfill.Continue ) {
@@ -589,12 +587,6 @@ func spokeMachineDeployment(in *MachineDeployment, c randfill.Continue) {
589587	fillMachineSpec (& in .Spec .Template .Spec , c , in .Namespace )
590588
591589	dropEmptyStringsMachineSpec (& in .Spec .Template .Spec )
592- 
593- 	if  in .Spec .Strategy  !=  nil  &&  in .Spec .Strategy .RollingUpdate  !=  nil  && 
594- 		in .Spec .Strategy .RollingUpdate .DeletePolicy  !=  nil  &&  * in .Spec .Strategy .RollingUpdate .DeletePolicy  ==  ""  {
595- 		// &"" Is not a valid value for DeletePolicy as the enum validation enforces an enum value if DeletePolicy is set. 
596- 		in .Spec .Strategy .RollingUpdate .DeletePolicy  =  nil 
597- 	}
598590}
599591
600592func  spokeMachineDeploymentSpec (in  * MachineDeploymentSpec , c  randfill.Continue ) {
@@ -605,6 +597,24 @@ func spokeMachineDeploymentSpec(in *MachineDeploymentSpec, c randfill.Continue)
605597
606598	// Drop RevisionHistoryLimit as we intentionally don't preserve it. 
607599	in .RevisionHistoryLimit  =  nil 
600+ 
601+ 	if  in .Strategy  !=  nil  {
602+ 		if  in .Strategy .RollingUpdate  !=  nil  {
603+ 			if  in .Strategy .RollingUpdate .DeletePolicy  !=  nil  &&  * in .Strategy .RollingUpdate .DeletePolicy  ==  ""  {
604+ 				// &"" Is not a valid value for DeletePolicy as the enum validation enforces an enum value if DeletePolicy is set. 
605+ 				in .Strategy .RollingUpdate .DeletePolicy  =  nil 
606+ 			}
607+ 			if  reflect .DeepEqual (in .Strategy .RollingUpdate , & MachineRollingUpdateDeployment {}) {
608+ 				in .Strategy .RollingUpdate  =  nil 
609+ 			}
610+ 		}
611+ 		if  in .Strategy .Remediation  !=  nil  &&  reflect .DeepEqual (in .Strategy .Remediation , & RemediationStrategy {}) {
612+ 			in .Strategy .Remediation  =  nil 
613+ 		}
614+ 		if  reflect .DeepEqual (in .Strategy , & MachineDeploymentStrategy {}) {
615+ 			in .Strategy  =  nil 
616+ 		}
617+ 	}
608618}
609619
610620func  spokeMachineDeploymentStatus (in  * MachineDeploymentStatus , c  randfill.Continue ) {
@@ -726,6 +736,10 @@ func spokeControlPlaneTopology(in *ControlPlaneTopology, c randfill.Continue) {
726736	if  in .NodeDeletionTimeout  !=  nil  {
727737		in .NodeDeletionTimeout  =  ptr.To [metav1.Duration ](metav1.Duration {Duration : time .Duration (c .Int31 ()) *  time .Second })
728738	}
739+ 
740+ 	if  in .Variables  !=  nil  &&  reflect .DeepEqual (in .Variables , & ControlPlaneVariables {}) {
741+ 		in .Variables  =  nil 
742+ 	}
729743}
730744
731745func  spokeMachineDeploymentTopology (in  * MachineDeploymentTopology , c  randfill.Continue ) {
@@ -740,6 +754,26 @@ func spokeMachineDeploymentTopology(in *MachineDeploymentTopology, c randfill.Co
740754	if  in .NodeDeletionTimeout  !=  nil  {
741755		in .NodeDeletionTimeout  =  ptr.To [metav1.Duration ](metav1.Duration {Duration : time .Duration (c .Int31 ()) *  time .Second })
742756	}
757+ 	if  in .Variables  !=  nil  &&  reflect .DeepEqual (in .Variables , & MachineDeploymentVariables {}) {
758+ 		in .Variables  =  nil 
759+ 	}
760+ 	if  in .Strategy  !=  nil  {
761+ 		if  in .Strategy .RollingUpdate  !=  nil  {
762+ 			if  in .Strategy .RollingUpdate .DeletePolicy  !=  nil  &&  * in .Strategy .RollingUpdate .DeletePolicy  ==  ""  {
763+ 				// &"" Is not a valid value for DeletePolicy as the enum validation enforces an enum value if DeletePolicy is set. 
764+ 				in .Strategy .RollingUpdate .DeletePolicy  =  nil 
765+ 			}
766+ 			if  reflect .DeepEqual (in .Strategy .RollingUpdate , & MachineRollingUpdateDeployment {}) {
767+ 				in .Strategy .RollingUpdate  =  nil 
768+ 			}
769+ 		}
770+ 		if  in .Strategy .Remediation  !=  nil  &&  reflect .DeepEqual (in .Strategy .Remediation , & RemediationStrategy {}) {
771+ 			in .Strategy .Remediation  =  nil 
772+ 		}
773+ 		if  reflect .DeepEqual (in .Strategy , & MachineDeploymentStrategy {}) {
774+ 			in .Strategy  =  nil 
775+ 		}
776+ 	}
743777}
744778
745779func  spokeMachinePoolTopology (in  * MachinePoolTopology , c  randfill.Continue ) {
@@ -754,6 +788,9 @@ func spokeMachinePoolTopology(in *MachinePoolTopology, c randfill.Continue) {
754788	if  in .NodeDeletionTimeout  !=  nil  {
755789		in .NodeDeletionTimeout  =  ptr.To [metav1.Duration ](metav1.Duration {Duration : time .Duration (c .Int31 ()) *  time .Second })
756790	}
791+ 	if  in .Variables  !=  nil  &&  reflect .DeepEqual (in .Variables , & MachinePoolVariables {}) {
792+ 		in .Variables  =  nil 
793+ 	}
757794}
758795
759796func  spokeMachineHealthCheckClass (in  * MachineHealthCheckClass , c  randfill.Continue ) {
@@ -790,6 +827,23 @@ func spokeMachineDeploymentClass(in *MachineDeploymentClass, c randfill.Continue
790827	if  in .NodeDeletionTimeout  !=  nil  {
791828		in .NodeDeletionTimeout  =  ptr.To [metav1.Duration ](metav1.Duration {Duration : time .Duration (c .Int31 ()) *  time .Second })
792829	}
830+ 	if  in .Strategy  !=  nil  {
831+ 		if  in .Strategy .RollingUpdate  !=  nil  {
832+ 			if  in .Strategy .RollingUpdate .DeletePolicy  !=  nil  &&  * in .Strategy .RollingUpdate .DeletePolicy  ==  ""  {
833+ 				// &"" Is not a valid value for DeletePolicy as the enum validation enforces an enum value if DeletePolicy is set. 
834+ 				in .Strategy .RollingUpdate .DeletePolicy  =  nil 
835+ 			}
836+ 			if  reflect .DeepEqual (in .Strategy .RollingUpdate , & MachineRollingUpdateDeployment {}) {
837+ 				in .Strategy .RollingUpdate  =  nil 
838+ 			}
839+ 		}
840+ 		if  in .Strategy .Remediation  !=  nil  &&  reflect .DeepEqual (in .Strategy .Remediation , & RemediationStrategy {}) {
841+ 			in .Strategy .Remediation  =  nil 
842+ 		}
843+ 		if  reflect .DeepEqual (in .Strategy , & MachineDeploymentStrategy {}) {
844+ 			in .Strategy  =  nil 
845+ 		}
846+ 	}
793847}
794848
795849func  spokeMachinePoolClass (in  * MachinePoolClass , c  randfill.Continue ) {
0 commit comments