@@ -99,6 +99,7 @@ func KubeadmControlPlaneTemplateFuzzFuncs(_ runtimeserializer.CodecFactory) []in
9999 spokeDiscovery ,
100100 hubKubeadmConfigSpec ,
101101 hubNodeRegistrationOptions ,
102+ hubKubeadmControlPlaneTemplate ,
102103 spokeKubeadmControlPlaneTemplate ,
103104 spokeRemediationStrategy ,
104105 spokeKubeadmControlPlaneTemplateMachineTemplate ,
@@ -364,6 +365,15 @@ func spokeClusterConfiguration(in *bootstrapv1beta1.ClusterConfiguration, c rand
364365 }
365366}
366367
368+ func hubKubeadmControlPlaneTemplate (in * controlplanev1.KubeadmControlPlaneTemplate , c randfill.Continue ) {
369+ c .FillNoCustom (in )
370+
371+ // In v1beta2 Type is required and RollingUpdateStrategyType is the only valid value.
372+ if in .Spec .Template .Spec .Rollout .Strategy .Type == "" {
373+ in .Spec .Template .Spec .Rollout .Strategy .Type = controlplanev1 .RollingUpdateStrategyType
374+ }
375+ }
376+
367377func spokeKubeadmControlPlaneTemplate (in * KubeadmControlPlaneTemplate , c randfill.Continue ) {
368378 c .FillNoCustom (in )
369379
@@ -384,6 +394,13 @@ func spokeKubeadmControlPlaneTemplate(in *KubeadmControlPlaneTemplate, c randfil
384394 if reflect .DeepEqual (in .Spec .Template .Spec .MachineNamingStrategy , & MachineNamingStrategy {}) {
385395 in .Spec .Template .Spec .MachineNamingStrategy = nil
386396 }
397+
398+ // In v1beta1 Type was always defaulted to RollingUpdateStrategyType.
399+ // RollingUpdateStrategyType is also the only valid value.
400+ if in .Spec .Template .Spec .RolloutStrategy != nil &&
401+ in .Spec .Template .Spec .RolloutStrategy .Type == "" {
402+ in .Spec .Template .Spec .RolloutStrategy .Type = RollingUpdateStrategyType
403+ }
387404}
388405
389406func spokeRemediationStrategy (in * RemediationStrategy , c randfill.Continue ) {
0 commit comments