@@ -1183,7 +1183,7 @@ var _ = ginkgo.Describe("ClusterManager Default Mode", ginkgo.Ordered, func() {
1183
1183
1184
1184
ginkgo .It ("should have labels on resources created by clustermanager" , func () {
1185
1185
1186
- labels := map [string ]string {"app" : "clustermanager" , " createdByClusterManager" : "hub" , "test-label" : "test-value" , "test-label2" : "test-value2" }
1186
+ labels := map [string ]string {"createdByClusterManager" : "hub" , "test-label" : "test-value" , "test-label2" : "test-value2" }
1187
1187
gomega .Eventually (func () error {
1188
1188
clusterManager , err := operatorClient .OperatorV1 ().ClusterManagers ().Get (context .Background (), clusterManagerName , metav1.GetOptions {})
1189
1189
if err != nil {
@@ -1202,9 +1202,8 @@ var _ = ginkgo.Describe("ClusterManager Default Mode", ginkgo.Ordered, func() {
1202
1202
if err != nil {
1203
1203
return err
1204
1204
}
1205
- if ! helpers .MapCompare (registrationDeployment .GetLabels (), labels ) {
1206
- return fmt .Errorf ("expected registration-controller labels to be %v, but got %v" , labels , registrationDeployment .GetLabels ())
1207
- }
1205
+ registrationLabels := registrationDeployment .GetLabels ()
1206
+ util .MapConsists (registrationLabels , labels )
1208
1207
return nil
1209
1208
}, eventuallyTimeout , eventuallyInterval ).Should (gomega .BeNil ())
1210
1209
@@ -1226,57 +1225,48 @@ var _ = ginkgo.Describe("ClusterManager Default Mode", ginkgo.Ordered, func() {
1226
1225
if err != nil {
1227
1226
return err
1228
1227
}
1229
- if ! helpers .MapCompare (registrationDeployment .GetLabels (), labels ) {
1230
- return fmt .Errorf ("expected registration-webhook labels to be %v, but got %v" , labels , registrationDeployment .GetLabels ())
1231
- }
1228
+ util .MapConsists (registrationDeployment .GetLabels (), labels )
1232
1229
return nil
1233
1230
}, eventuallyTimeout , eventuallyInterval ).Should (gomega .BeNil ())
1234
1231
1235
1232
// Compare labels on work-webhook
1236
1233
gomega .Eventually (func () error {
1237
- registrationDeployment , err := kubeClient .AppsV1 ().Deployments (hubNamespace ).Get (context .Background (), hubWorkWebhookDeployment , metav1.GetOptions {})
1234
+ k8sHubWorkWebhookDeployment , err := kubeClient .AppsV1 ().Deployments (hubNamespace ).Get (context .Background (), hubWorkWebhookDeployment , metav1.GetOptions {})
1238
1235
if err != nil {
1239
1236
return err
1240
1237
}
1241
- if ! helpers .MapCompare (registrationDeployment .GetLabels (), labels ) {
1242
- return fmt .Errorf ("expected work-webhook labels to be %v, but got %v" , labels , registrationDeployment .GetLabels ())
1243
- }
1238
+ util .MapConsists (k8sHubWorkWebhookDeployment .GetLabels (), labels )
1244
1239
return nil
1245
1240
}, eventuallyTimeout , eventuallyInterval ).Should (gomega .BeNil ())
1246
1241
1247
1242
// Compare labels on placement-controller
1248
1243
gomega .Eventually (func () error {
1249
- registrationDeployment , err := kubeClient .AppsV1 ().Deployments (hubNamespace ).Get (context .Background (), hubPlacementDeployment , metav1.GetOptions {})
1244
+ k8sHubPlacementDeployment , err := kubeClient .AppsV1 ().Deployments (hubNamespace ).Get (context .Background (), hubPlacementDeployment , metav1.GetOptions {})
1250
1245
if err != nil {
1251
1246
return err
1252
1247
}
1253
- if ! helpers .MapCompare (registrationDeployment .GetLabels (), labels ) {
1254
- return fmt .Errorf ("expected placement-controller labels to be %v, but got %v" , labels , registrationDeployment .GetLabels ())
1255
- }
1248
+ util .MapConsists (k8sHubPlacementDeployment .GetLabels (), labels )
1256
1249
return nil
1257
1250
}, eventuallyTimeout , eventuallyInterval ).Should (gomega .BeNil ())
1258
1251
1259
1252
// Compare labels on addon-manager-controller
1260
1253
gomega .Eventually (func () error {
1261
- registrationDeployment , err := kubeClient .AppsV1 ().Deployments (hubNamespace ).Get (context .Background (), hubAddOnManagerDeployment , metav1.GetOptions {})
1254
+ k8sHubAddOnManagerDeployment , err := kubeClient .AppsV1 ().Deployments (hubNamespace ).Get (context .Background (), hubAddOnManagerDeployment , metav1.GetOptions {})
1262
1255
if err != nil {
1263
1256
return err
1264
1257
}
1265
- if ! helpers .MapCompare (registrationDeployment .GetLabels (), labels ) {
1266
- return fmt .Errorf ("expected labels addon-manager-controller to be %v, but got %v" , labels , registrationDeployment .GetLabels ())
1267
- }
1258
+ util .MapConsists (k8sHubAddOnManagerDeployment .GetLabels (), labels )
1268
1259
return nil
1269
1260
}, eventuallyTimeout , eventuallyInterval ).Should (gomega .BeNil ())
1270
1261
1271
1262
// Compare labels on work-controller
1272
1263
gomega .Eventually (func () error {
1273
- registrationDeployment , err := kubeClient .AppsV1 ().Deployments (hubNamespace ).Get (context .Background (), hubWorkControllerDeployment , metav1.GetOptions {})
1264
+ k8sHubWorkControllerDeployment , err := kubeClient .AppsV1 ().Deployments (hubNamespace ).
1265
+ Get (context .Background (), hubWorkControllerDeployment , metav1.GetOptions {})
1274
1266
if err != nil {
1275
1267
return err
1276
1268
}
1277
- if ! helpers .MapCompare (registrationDeployment .GetLabels (), labels ) {
1278
- return fmt .Errorf ("expected work-controller labels to be %v, but got %v" , labels , registrationDeployment .GetLabels ())
1279
- }
1269
+ util .MapConsists (k8sHubWorkControllerDeployment .GetLabels (), labels )
1280
1270
return nil
1281
1271
}, eventuallyTimeout , eventuallyInterval ).Should (gomega .BeNil ())
1282
1272
})
0 commit comments