Merge pull request #76690 from SataQiu/fix-golint-kubelet-20190417

Fix some golint failures of pkg/kubelet
This commit is contained in:
Kubernetes Prow Robot 2019-04-24 12:24:51 -07:00 committed by GitHub
commit 5c4a59f9af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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))
}
}