@@ -268,7 +268,7 @@ func assertClusterObjects(ctx context.Context, clusterProxy framework.ClusterPro
268
268
assertMachineSetsMachines (g , clusterObjects , cluster )
269
269
270
270
By ("All cluster objects have the right labels, annotations and selectors" )
271
- }, 30 * time .Second , 1 * time .Second ).Should (Succeed ())
271
+ }, 10 * time .Second , 1 * time .Second ).Should (Succeed ())
272
272
}
273
273
274
274
func assertInfrastructureCluster (g Gomega , clusterClassObjects clusterClassObjects , clusterObjects clusterObjects , cluster * clusterv1.Cluster , clusterClass * clusterv1.ClusterClass ) {
@@ -443,7 +443,7 @@ func assertControlPlaneMachines(g Gomega, clusterObjects clusterObjects, cluster
443
443
g .Expect (
444
444
union (
445
445
bootstrapConfig .GetAnnotations (),
446
- ).without (clusterv1 .MachineCertificatesExpiryDateAnnotation ),
446
+ ).ignore (clusterv1 .MachineCertificatesExpiryDateAnnotation ),
447
447
).To (BeEquivalentTo (
448
448
controlPlaneMachineTemplateMetadata .Annotations ,
449
449
))
@@ -820,6 +820,16 @@ func (m unionMap) without(keys ...string) unionMap {
820
820
return m
821
821
}
822
822
823
+ // ignore removes keys from a unionMap only if they exist.
824
+ // Note: This allows ignoring specific keys while comparing maps and is a more tolerant version of `without()`.
825
+ func (m unionMap ) ignore (keys ... string ) unionMap {
826
+ for _ , key := range keys {
827
+ // Only remove the item from the map if it exists.
828
+ delete (m , key )
829
+ }
830
+ return m
831
+ }
832
+
823
833
// getManagedLabels gets a map[string]string and returns another map[string]string
824
834
// filtering out labels not managed by CAPI.
825
835
// Note: This is replicated from machine_controller_noderef.go.
0 commit comments