Skip to content

Commit

Permalink
Log error if GetVRGFromManagedCluster failed
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nirs authored and BenamarMk committed Dec 11, 2024
1 parent 2753759 commit 342d73d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/controller/drplacementcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 342d73d

Please sign in to comment.