diff --git a/controllers/drplacementcontrol_controller_test.go b/controllers/drplacementcontrol_controller_test.go index 4e9fe073c5..f0fc62e1f0 100644 --- a/controllers/drplacementcontrol_controller_test.go +++ b/controllers/drplacementcontrol_controller_test.go @@ -395,7 +395,7 @@ func resetClusterDown() { } //nolint:funlen,cyclop,gocognit -func (FakeMCVGetter) GetVRGFromManagedCluster(_, _, managedCluster string, +func (FakeMCVGetter) GetVRGFromManagedCluster(_, resourceNamespace, managedCluster string, _ map[string]string, ) (*rmn.VolumeReplicationGroup, error) { conType := controllers.VRGConditionTypeDataReady @@ -1167,7 +1167,7 @@ const ( UsePlacementWithAppSet = 3 ) -func InitialDeploymentAsync(namespace, placementName string, plType PlacementType) ( +func InitialDeploymentAsync(namespace, placementName, homeCluster string, plType PlacementType) ( client.Object, *rmn.DRPlacementControl, ) { createNamespacesAsync(getNamespaceObj(namespace)) @@ -1200,7 +1200,7 @@ func CreatePlacementAndDRPC(namespace, placementName, homeCluster string, plType return placementObj, createDRPC(placementName, DRPCCommonName, namespace, AsyncDRPolicyName, homeCluster) } -func FollowOnDeploymentAsync(namespace, placementName string) (*plrv1.PlacementRule, +func FollowOnDeploymentAsync(namespace, placementName, homeCluster string) (*plrv1.PlacementRule, *rmn.DRPlacementControl, ) { createNamespace(appNamespace2) @@ -1638,7 +1638,7 @@ func createNamespacesSync() { createNamespace(appNamespace) } -func InitialDeploymentSync(namespace, placementName string) (*plrv1.PlacementRule, +func InitialDeploymentSync(namespace, placementName, homeCluster string) (*plrv1.PlacementRule, *rmn.DRPlacementControl, ) { createNamespacesSync() @@ -1869,7 +1869,7 @@ var _ = Describe("DRPlacementControl Reconciler", func() { By("Initial Deployment") var placementObj client.Object placementObj, drpc = InitialDeploymentAsync( - DefaultDRPCNamespace, UserPlacementRuleName, UsePlacementRule) + DefaultDRPCNamespace, UserPlacementRuleName, East1ManagedCluster, UsePlacementRule) userPlacementRule = placementObj.(*plrv1.PlacementRule) Expect(userPlacementRule).NotTo(BeNil()) verifyInitialDRPCDeployment(userPlacementRule, East1ManagedCluster) @@ -1936,7 +1936,7 @@ var _ = Describe("DRPlacementControl Reconciler", func() { }) When("A DRPC is created referring to a deleted DRPolicy", func() { It("Should fail DRPC reconciliaiton and not add a finalizer", func() { - _, drpc2 := FollowOnDeploymentAsync(DRPC2NamespaceName, UserPlacementRuleName) + _, drpc2 := FollowOnDeploymentAsync(DRPC2NamespaceName, UserPlacementRuleName, East1ManagedCluster) checkIfDRPCFinalizerNotAdded(drpc2) Expect(k8sClient.Delete(context.TODO(), drpc2)).Should(Succeed()) }) @@ -1981,7 +1981,7 @@ var _ = Describe("DRPlacementControl Reconciler", func() { By("Initial Deployment") var placementObj client.Object placementObj, drpc = InitialDeploymentAsync( - DefaultDRPCNamespace, UserPlacementName, UsePlacementWithSubscription) + DefaultDRPCNamespace, UserPlacementName, East1ManagedCluster, UsePlacementWithSubscription) placement = placementObj.(*clrapiv1beta1.Placement) Expect(placement).NotTo(BeNil()) verifyInitialDRPCDeployment(placement, East1ManagedCluster) @@ -2057,7 +2057,7 @@ var _ = Describe("DRPlacementControl Reconciler", func() { getBaseVRG(DefaultDRPCNamespace).ObjectMeta.Namespace = ApplicationNamespace var placementObj client.Object placementObj, drpc = InitialDeploymentAsync( - DefaultDRPCNamespace, UserPlacementName, UsePlacementWithAppSet) + DefaultDRPCNamespace, UserPlacementName, East1ManagedCluster, UsePlacementWithAppSet) placement = placementObj.(*clrapiv1beta1.Placement) Expect(placement).NotTo(BeNil()) verifyInitialDRPCDeployment(placement, East1ManagedCluster) @@ -2141,7 +2141,7 @@ var _ = Describe("DRPlacementControl Reconciler", func() { When("An Application is deployed for the first time", func() { It("Should deploy to East1ManagedCluster", func() { By("Initial Deployment") - userPlacementRule, _ = InitialDeploymentSync(DefaultDRPCNamespace, UserPlacementRuleName) + userPlacementRule, _ = InitialDeploymentSync(DefaultDRPCNamespace, UserPlacementRuleName, East1ManagedCluster) verifyInitialDRPCDeployment(userPlacementRule, East1ManagedCluster) verifyDRPCOwnedByPlacement(userPlacementRule, getLatestDRPC(DefaultDRPCNamespace)) }) @@ -2217,7 +2217,7 @@ var _ = Describe("DRPlacementControl Reconciler", func() { When("An Application is deployed for the first time", func() { It("Should deploy to East1ManagedCluster", func() { By("Initial Deployment") - userPlacementRule, _ = InitialDeploymentSync(DefaultDRPCNamespace, UserPlacementRuleName) + userPlacementRule, _ = InitialDeploymentSync(DefaultDRPCNamespace, UserPlacementRuleName, East1ManagedCluster) verifyInitialDRPCDeployment(userPlacementRule, East1ManagedCluster) verifyDRPCOwnedByPlacement(userPlacementRule, getLatestDRPC(DefaultDRPCNamespace)) })