@@ -150,7 +150,7 @@ type testHelperInterface interface {
150150 updateVariableInE2eConfig (variableKey string , variableValue string )
151151 stripNutanixIDFromProviderID (providerID string ) string
152152 verifyCategoryExists (ctx context.Context , categoryKey , categoyValue string )
153- verifyCategoriesNutanixMachines (ctx context.Context , clusterName , namespace string , expectedCategories map [string ]string )
153+ verifyCategoriesNutanixMachines (ctx context.Context , clusterName , namespace string , expectedCategories map [string ][] string )
154154 verifyConditionOnNutanixCluster (params verifyConditionParams )
155155 verifyConditionOnNutanixMachines (params verifyConditionParams )
156156 verifyDisksOnNutanixMachines (ctx context.Context , params verifyDisksOnNutanixMachinesParams )
@@ -641,19 +641,30 @@ func (t testHelper) verifyCategoryExists(ctx context.Context, categoryKey, categ
641641 Expect (err ).ShouldNot (HaveOccurred ())
642642}
643643
644- func (t testHelper ) verifyCategoriesNutanixMachines (ctx context.Context , clusterName , namespace string , expectedCategories map [string ]string ) {
645- nutanixMachines := t .getMachinesForCluster (ctx , clusterName , namespace , bootstrapClusterProxy )
646- for _ , m := range nutanixMachines .Items {
647- machineProviderID := m .Spec .ProviderID
648- Expect (machineProviderID ).NotTo (BeNil ())
649- machineVmUUID := t .stripNutanixIDFromProviderID (* machineProviderID )
650- vm , err := t .nutanixClient .V3 .GetVM (ctx , machineVmUUID )
651- Expect (err ).ShouldNot (HaveOccurred ())
652- categoriesMeta := vm .Metadata .Categories
653- for k , v := range expectedCategories {
654- Expect (categoriesMeta ).To (HaveKeyWithValue (k , v ))
655- }
656- }
644+ func (t testHelper ) verifyCategoriesNutanixMachines (ctx context.Context , clusterName , namespace string , expectedCategories map [string ][]string ) {
645+ Eventually (
646+ func (g Gomega ) {
647+ nutanixMachines := t .getMachinesForCluster (ctx , clusterName , namespace , bootstrapClusterProxy )
648+ for _ , m := range nutanixMachines .Items {
649+ machineProviderID := m .Spec .ProviderID
650+ g .Expect (machineProviderID ).NotTo (BeNil ())
651+ machineVmUUID := t .stripNutanixIDFromProviderID (* machineProviderID )
652+ vm , err := t .nutanixClient .V3 .GetVM (ctx , machineVmUUID )
653+ g .Expect (err ).ShouldNot (HaveOccurred ())
654+ categoriesMappingMeta := vm .Metadata .CategoriesMapping
655+ for k , v := range expectedCategories {
656+ g .Expect (categoriesMappingMeta ).To (HaveKey (k ))
657+ vals := make ([]any , len (v ))
658+ for i := range v {
659+ vals [i ] = v [i ]
660+ }
661+ g .Expect (categoriesMappingMeta [k ]).To (ConsistOf (vals ... ))
662+ }
663+ }
664+ },
665+ defaultTimeout ,
666+ defaultInterval ,
667+ ).Should (Succeed ())
657668}
658669
659670type verifyResourceConfigOnNutanixMachinesParams struct {
0 commit comments