Skip to content

Commit

Permalink
Avoid duplicate results in liveness checker
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchangelSDY committed Jul 14, 2022
1 parent 1e850fd commit 74ea005
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/checkers/liveness/liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"strings"

"github.com/Azure/kdebug/pkg/base"
log "github.com/sirupsen/logrus"
)

const (
Expand All @@ -30,11 +31,7 @@ func (c *LivenessChecker) Check(ctx *base.CheckContext) ([]*base.CheckResult, er
out, err := exec.Command("systemctl", "status", "kubelet").Output()

if err != nil {
results = append(results, &base.CheckResult{
Checker: c.Name(),
Error: FailedToCheckLiveness,
Description: err.Error(),
})
log.Debugf("systemctl status returned non-zero exit code: %+v", err)
}

results = append(results, parseOutput(out))
Expand Down

0 comments on commit 74ea005

Please sign in to comment.