fix some golint failures of pkg/kubelet

This commit is contained in:
SataQiu 2019-04-22 10:40:51 +08:00
parent 75d45bdfc9
commit f5736f3fd1
2 changed files with 5 additions and 3 deletions

View File

@ -19,9 +19,11 @@ package kubelet
import "errors"
const (
// NetworkNotReadyErrorMsg is used to describe the error that network is not ready
NetworkNotReadyErrorMsg = "network is not ready"
)
var (
// ErrNetworkUnknown indicates the network state is unknown
ErrNetworkUnknown = errors.New("network state unknown")
)

View File

@ -85,13 +85,13 @@ func (s *runtimeState) runtimeErrors() error {
defer s.RUnlock()
errs := []error{}
if s.lastBaseRuntimeSync.IsZero() {
errs = append(errs, errors.New("container runtime status check may not have completed yet."))
errs = append(errs, errors.New("container runtime status check may not have completed yet"))
} else if !s.lastBaseRuntimeSync.Add(s.baseRuntimeSyncThreshold).After(time.Now()) {
errs = append(errs, errors.New("container runtime is down."))
errs = append(errs, errors.New("container runtime is down"))
}
for _, hc := range s.healthChecks {
if ok, err := hc.fn(); !ok {
errs = append(errs, fmt.Errorf("%s is not healthy: %v.", hc.name, err))
errs = append(errs, fmt.Errorf("%s is not healthy: %v", hc.name, err))
}
}