From 342d73d4407266651cc6dc1c2eeed06d88860d45 Mon Sep 17 00:00:00 2001 From: Nir Soffer Date: Tue, 10 Dec 2024 15:24:29 +0200 Subject: [PATCH] Log error if GetVRGFromManagedCluster failed We returned false, swallowing the error silently. The drpc remained in this state: - lastTransitionTime: "2024-12-10T12:45:26Z" message: unable to start failover, spec.FailoverCluster (dr2) is not a valid Secondary target With no clue why dr2 is not a valid Secondary cluster. The new log may explain the reason. Signed-off-by: Nir Soffer --- internal/controller/drplacementcontrol.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/controller/drplacementcontrol.go b/internal/controller/drplacementcontrol.go index 7ae5a66a8..fea58b024 100644 --- a/internal/controller/drplacementcontrol.go +++ b/internal/controller/drplacementcontrol.go @@ -398,6 +398,9 @@ func (d *DRPCInstance) isValidFailoverTarget(cluster string) bool { vrg, err := d.reconciler.MCVGetter.GetVRGFromManagedCluster(d.instance.Name, d.vrgNamespace, cluster, annotations) if err != nil { + d.log.Info("Failed to get VRG from managed cluster", "name", d.instance.Name, "namespace", d.vrgNamespace, + "cluster", cluster, "annotations", annotations, "error", err) + return false }