diff --git a/controllers/drplacementcontrol.go b/controllers/drplacementcontrol.go index 20c739ae6..9165d5230 100644 --- a/controllers/drplacementcontrol.go +++ b/controllers/drplacementcontrol.go @@ -295,7 +295,7 @@ func (d *DRPCInstance) startDeploying(homeCluster, homeClusterNamespace string) // All good, update the preferred decision and state d.instance.Status.PreferredDecision.ClusterName = d.instance.Spec.PreferredCluster - d.instance.Status.PreferredDecision.ClusterNamespace = d.vrgNamespace + d.instance.Status.PreferredDecision.ClusterNamespace = d.instance.Spec.PreferredCluster d.log.Info("Updated PreferredDecision", "PreferredDecision", d.instance.Status.PreferredDecision) @@ -1356,7 +1356,7 @@ func (d *DRPCInstance) updatePreferredDecision() { reflect.DeepEqual(d.instance.Status.PreferredDecision, plrv1.PlacementDecision{}) { d.instance.Status.PreferredDecision = plrv1.PlacementDecision{ ClusterName: d.instance.Spec.PreferredCluster, - ClusterNamespace: d.vrgNamespace, + ClusterNamespace: d.instance.Spec.PreferredCluster, } } } diff --git a/controllers/drplacementcontrol_controller.go b/controllers/drplacementcontrol_controller.go index a2f045e7b..dbdb73bc8 100644 --- a/controllers/drplacementcontrol_controller.go +++ b/controllers/drplacementcontrol_controller.go @@ -1009,7 +1009,7 @@ func (r *DRPlacementControlReconciler) finalizeDRPC(ctx context.Context, drpc *r Ctx: ctx, Log: r.Log, InstName: drpc.Name, - TargetNamespace: drpc.Status.PreferredDecision.ClusterNamespace, + TargetNamespace: vrgNamespace, } drPolicy, err := r.getDRPolicy(ctx, drpc, log) @@ -1811,10 +1811,6 @@ func selectVRGNamespace( drpc *rmn.DRPlacementControl, placementObj client.Object, ) (string, error) { - if drpc.Status.PreferredDecision.ClusterNamespace != "" { - return drpc.Status.PreferredDecision.ClusterNamespace, nil - } - switch placementObj.(type) { case *clrapiv1beta1.Placement: vrgNamespace, err := getApplicationDestinationNamespace(client, log, placementObj)