@@ -265,13 +265,14 @@ func assertMetadataOnClusterObjects(ctx context.Context, clusterProxy framework.
265
265
clusterObjects := getClusterObjects (ctx , g , clusterProxy , cluster )
266
266
267
267
// InfrastructureCluster
268
+ infrastructureClusterTemplateTemplateMetadata := mustMetadata (contract .InfrastructureClusterTemplate ().Template ().Metadata ().Get (clusterClassObjects .InfrastructureClusterTemplate ))
268
269
g .Expect (clusterObjects .InfrastructureCluster .GetLabels ()).To (BeEquivalentTo (
269
270
union (
270
271
map [string ]string {
271
272
clusterv1 .ClusterNameLabel : cluster .Name ,
272
273
clusterv1 .ClusterTopologyOwnedLabel : "" ,
273
274
},
274
- templateMetadata ( clusterClassObjects . InfrastructureClusterTemplate ) .Labels ,
275
+ infrastructureClusterTemplateTemplateMetadata .Labels ,
275
276
),
276
277
))
277
278
g .Expect (clusterObjects .InfrastructureCluster .GetAnnotations ()).To (BeEquivalentTo (
@@ -280,7 +281,7 @@ func assertMetadataOnClusterObjects(ctx context.Context, clusterProxy framework.
280
281
clusterv1 .TemplateClonedFromGroupKindAnnotation : groupKind (clusterClass .Spec .Infrastructure .Ref ),
281
282
clusterv1 .TemplateClonedFromNameAnnotation : clusterClass .Spec .Infrastructure .Ref .Name ,
282
283
},
283
- templateMetadata ( clusterClassObjects . InfrastructureClusterTemplate ) .Annotations ,
284
+ infrastructureClusterTemplateTemplateMetadata .Annotations ,
284
285
),
285
286
))
286
287
@@ -307,8 +308,8 @@ func assertMetadataOnClusterObjects(ctx context.Context, clusterProxy framework.
307
308
templateMetadata (clusterClassObjects .ControlPlaneTemplate ).Annotations ,
308
309
),
309
310
))
310
- controlPlaneMachineTemplateMetadata , err := contract . ControlPlane (). MachineTemplate (). Metadata (). Get ( clusterObjects . ControlPlane )
311
- g . Expect ( err ). NotTo ( HaveOccurred ( ))
311
+
312
+ controlPlaneMachineTemplateMetadata := mustMetadata ( contract . ControlPlane (). MachineTemplate (). Metadata (). Get ( clusterObjects . ControlPlane ))
312
313
g .Expect (controlPlaneMachineTemplateMetadata .Labels ).To (BeEquivalentTo (
313
314
union (
314
315
map [string ]string {
@@ -672,7 +673,14 @@ func assertMetadataOnClusterObjects(ctx context.Context, clusterProxy framework.
672
673
}
673
674
674
675
By ("All cluster objects have the right labels, annotations and selectors" )
675
- }, 10 * time .Minute , 1 * time .Second ).Should (Succeed ()) // FIXME: timeouts, look at actual rollout times
676
+ }, 10 * time .Minute , 1 * time .Second ).Should (Succeed ()) // FIXME: timeouts, look at actual rollout times => check if we should wait before calling this func for complete rollout (including nodes)
677
+ }
678
+
679
+ func mustMetadata (metadata * clusterv1.ObjectMeta , err error ) * clusterv1.ObjectMeta {
680
+ if err != nil {
681
+ panic (err )
682
+ }
683
+ return metadata
676
684
}
677
685
678
686
func getMDTopology (cluster * clusterv1.Cluster , md * clusterv1.MachineDeployment ) * clusterv1.MachineDeploymentTopology {
0 commit comments