From eb21d75ef7d4b21ea32c7c88d05d3807ada13557 Mon Sep 17 00:00:00 2001 From: Rakshith R Date: Fri, 11 Nov 2022 20:29:39 +0530 Subject: [PATCH] rbd: ignore stdErr for ceph osd blocklist when there is no error `ceph osd blocklist range add/rm ` cmd is outputting "blocklisting cidr:10.1.114.75:0/32 until 202..." messages incorrectly into stdErr. This commit ignores stdErr when err is nil. Signed-off-by: Rakshith R --- internal/csi-addons/networkfence/fencing.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/csi-addons/networkfence/fencing.go b/internal/csi-addons/networkfence/fencing.go index 713b2a10e..60c3e61fa 100644 --- a/internal/csi-addons/networkfence/fencing.go +++ b/internal/csi-addons/networkfence/fencing.go @@ -91,9 +91,6 @@ func (nf *NetworkFence) addCephBlocklist(ctx context.Context, ip string, useRang if err != nil { return fmt.Errorf("failed to blocklist IP %q: %w stderr: %q", ip, err, stdErr) } - if stdErr != "" { - return fmt.Errorf("failed to blocklist IP %q: %q", ip, stdErr) - } log.DebugLog(ctx, "blocklisted IP %q successfully", ip) return nil @@ -195,9 +192,6 @@ func (nf *NetworkFence) removeCephBlocklist(ctx context.Context, ip string, useR if err != nil { return fmt.Errorf("failed to unblock IP %q: %v %w", ip, stdErr, err) } - if stdErr != "" { - return fmt.Errorf("failed to unblock IP %q: %q", ip, stdErr) - } log.DebugLog(ctx, "unblocked IP %q successfully", ip) return nil