Skip to content

Commit

Permalink
rbd: ignore stdErr for ceph osd blocklist when there is no error
Browse files Browse the repository at this point in the history
`ceph osd blocklist range add/rm <ip>` 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 <[email protected]>
  • Loading branch information
Rakshith-R authored and mergify[bot] committed Nov 12, 2022
1 parent e2832fd commit eb21d75
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions internal/csi-addons/networkfence/fencing.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb21d75

Please sign in to comment.