@@ -338,9 +338,13 @@ func TestMatchesKubeadmConfig(t *testing.T) {
338338 KubeadmConfigSpec : bootstrapv1.KubeadmConfigSpec {
339339 ClusterConfiguration : bootstrapv1.ClusterConfiguration {},
340340 JoinConfiguration : bootstrapv1.JoinConfiguration {
341- Timeouts : bootstrapv1.Timeouts {
342- ControlPlaneComponentHealthCheckSeconds : ptr.To [int32 ](5 ),
343- KubernetesAPICallSeconds : ptr.To [int32 ](7 ),
341+ Timeouts : bootstrapv1.Timeouts { // Timeouts are different, but they are ignored for the diff
342+ ControlPlaneComponentHealthCheckSeconds : ptr.To [int32 ](1 ),
343+ KubeletHealthCheckSeconds : ptr.To [int32 ](2 ),
344+ KubernetesAPICallSeconds : ptr.To [int32 ](3 ),
345+ EtcdAPICallSeconds : ptr.To [int32 ](4 ),
346+ TLSBootstrapSeconds : ptr.To [int32 ](5 ),
347+ DiscoverySeconds : ptr.To [int32 ](6 ),
344348 },
345349 Patches : bootstrapv1.Patches {
346350 Directory : "/test/patches" ,
@@ -391,9 +395,13 @@ func TestMatchesKubeadmConfig(t *testing.T) {
391395 Spec : bootstrapv1.KubeadmConfigSpec {
392396 // InitConfiguration will be converted to JoinConfiguration and then compared against the JoinConfiguration from KCP.
393397 InitConfiguration : bootstrapv1.InitConfiguration {
394- Timeouts : bootstrapv1.Timeouts {
395- ControlPlaneComponentHealthCheckSeconds : ptr.To [int32 ](5 ),
396- KubernetesAPICallSeconds : ptr.To [int32 ](7 ),
398+ Timeouts : bootstrapv1.Timeouts { // Timeouts are different, but they are ignored for the diff
399+ ControlPlaneComponentHealthCheckSeconds : ptr.To [int32 ](11 ),
400+ KubeletHealthCheckSeconds : ptr.To [int32 ](12 ),
401+ KubernetesAPICallSeconds : ptr.To [int32 ](13 ),
402+ EtcdAPICallSeconds : ptr.To [int32 ](14 ),
403+ TLSBootstrapSeconds : ptr.To [int32 ](15 ),
404+ DiscoverySeconds : ptr.To [int32 ](16 ),
397405 },
398406 Patches : bootstrapv1.Patches {
399407 Directory : "/test/patches" ,
@@ -612,7 +620,7 @@ func TestMatchesKubeadmConfig(t *testing.T) {
612620 g .Expect (match ).To (BeTrue ())
613621 g .Expect (reason ).To (BeEmpty ())
614622 })
615- t .Run ("returns true if JoinConfiguration is equal apart from discovery " , func (t * testing.T ) {
623+ t .Run ("returns true if JoinConfiguration is equal apart from Discovery and Timeouts " , func (t * testing.T ) {
616624 g := NewWithT (t )
617625 kcp := & controlplanev1.KubeadmControlPlane {
618626 Spec : controlplanev1.KubeadmControlPlaneSpec {
@@ -625,6 +633,14 @@ func TestMatchesKubeadmConfig(t *testing.T) {
625633 },
626634 // Discovery gets removed because Discovery is not relevant for the rollout decision.
627635 Discovery : bootstrapv1.Discovery {TLSBootstrapToken : "aaa" },
636+ Timeouts : bootstrapv1.Timeouts {
637+ ControlPlaneComponentHealthCheckSeconds : ptr.To [int32 ](1 ),
638+ KubeletHealthCheckSeconds : ptr.To [int32 ](2 ),
639+ KubernetesAPICallSeconds : ptr.To [int32 ](3 ),
640+ EtcdAPICallSeconds : ptr.To [int32 ](4 ),
641+ TLSBootstrapSeconds : ptr.To [int32 ](5 ),
642+ DiscoverySeconds : ptr.To [int32 ](6 ),
643+ },
628644 },
629645 },
630646 Version : "v1.30.0" ,
@@ -658,6 +674,14 @@ func TestMatchesKubeadmConfig(t *testing.T) {
658674 },
659675 // Discovery gets removed because Discovery is not relevant for the rollout decision.
660676 Discovery : bootstrapv1.Discovery {TLSBootstrapToken : "bbb" },
677+ Timeouts : bootstrapv1.Timeouts {
678+ ControlPlaneComponentHealthCheckSeconds : ptr.To [int32 ](11 ),
679+ KubeletHealthCheckSeconds : ptr.To [int32 ](12 ),
680+ KubernetesAPICallSeconds : ptr.To [int32 ](13 ),
681+ EtcdAPICallSeconds : ptr.To [int32 ](14 ),
682+ TLSBootstrapSeconds : ptr.To [int32 ](15 ),
683+ DiscoverySeconds : ptr.To [int32 ](16 ),
684+ },
661685 },
662686 },
663687 },
0 commit comments