From d21f226f6aff32b1d3ad3a82cd5eb1a666ceafb8 Mon Sep 17 00:00:00 2001 From: Eric Weber Date: Wed, 9 Aug 2023 14:58:23 -0500 Subject: [PATCH] Adhere to new replica scheduler error convention Signed-off-by: Eric Weber --- scheduler/replica_scheduler.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scheduler/replica_scheduler.go b/scheduler/replica_scheduler.go index 44e8ab9770..d44ff5dfab 100644 --- a/scheduler/replica_scheduler.go +++ b/scheduler/replica_scheduler.go @@ -170,7 +170,9 @@ func (rcs *ReplicaScheduler) getDiskCandidates(nodeInfo map[string]*longhorn.Nod diskSoftAntiAffinity, err := rcs.ds.GetSettingAsBool(types.SettingNameReplicaDiskSoftAntiAffinity) if err != nil { - logrus.Errorf("Error getting replica disk soft anti-affinity setting: %v", err) + err = errors.Wrapf(err, "failed to get %v setting", types.SettingNameReplicaDiskSoftAntiAffinity) + multiError.Append(util.NewMultiError(err.Error())) + return map[string]*Disk{}, multiError } if volume.Spec.ReplicaDiskSoftAntiAffinity != longhorn.ReplicaDiskSoftAntiAffinityDefault && volume.Spec.ReplicaDiskSoftAntiAffinity != "" {