Skip to content

Commit

Permalink
Merge pull request #18625 from redwrasse/redwrasse/ep-command-errors-is
Browse files Browse the repository at this point in the history
command: Use errors.Is for error equality check in ep_command.go
  • Loading branch information
ahrtr authored Sep 24, 2024
2 parents 7e04b33 + 6767e1f commit c79c7d5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion etcdctl/ctlv3/command/ep_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package command

import (
"errors"
"fmt"
"os"
"sync"
Expand Down Expand Up @@ -137,7 +138,7 @@ func epHealthCommandFunc(cmd *cobra.Command, args []string) {
_, err = cli.Get(ctx, "health")
eh := epHealth{Ep: ep, Health: false, Took: time.Since(st).String()}
// permission denied is OK since proposal goes through consensus to get it
if err == nil || err == rpctypes.ErrPermissionDenied {
if err == nil || errors.Is(err, rpctypes.ErrPermissionDenied) {
eh.Health = true
} else {
eh.Error = err.Error()
Expand Down

0 comments on commit c79c7d5

Please sign in to comment.