Fix golint for pkg/probe
This change adds comments to exported things and renames the tcp, http, and exec probe interfaces to just be Prober within their namespace. Issue #68026
This commit is contained in:
@@ -23,16 +23,21 @@ import (
|
||||
"github.com/golang/glog"
|
||||
)
|
||||
|
||||
func New() ExecProber {
|
||||
// New creates a Prober.
|
||||
func New() Prober {
|
||||
return execProber{}
|
||||
}
|
||||
|
||||
type ExecProber interface {
|
||||
// Prober is an interface defining the Probe object for container readiness/liveness checks.
|
||||
type Prober interface {
|
||||
Probe(e exec.Cmd) (probe.Result, string, error)
|
||||
}
|
||||
|
||||
type execProber struct{}
|
||||
|
||||
// Probe executes a command to check the liveness/readiness of container
|
||||
// from executing a command. Returns the Result status, command output, and
|
||||
// errors if any.
|
||||
func (pr execProber) Probe(e exec.Cmd) (probe.Result, string, error) {
|
||||
data, err := e.CombinedOutput()
|
||||
glog.V(4).Infof("Exec probe response: %q", string(data))
|
||||
@@ -41,9 +46,8 @@ func (pr execProber) Probe(e exec.Cmd) (probe.Result, string, error) {
|
||||
if ok {
|
||||
if exit.ExitStatus() == 0 {
|
||||
return probe.Success, string(data), nil
|
||||
} else {
|
||||
return probe.Failure, string(data), nil
|
||||
}
|
||||
return probe.Failure, string(data), nil
|
||||
}
|
||||
return probe.Unknown, "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user