mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
fix some golint failures of pkg/kubelet
This commit is contained in:
parent
75d45bdfc9
commit
f5736f3fd1
@ -19,9 +19,11 @@ package kubelet
|
|||||||
import "errors"
|
import "errors"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// NetworkNotReadyErrorMsg is used to describe the error that network is not ready
|
||||||
NetworkNotReadyErrorMsg = "network is not ready"
|
NetworkNotReadyErrorMsg = "network is not ready"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
// ErrNetworkUnknown indicates the network state is unknown
|
||||||
ErrNetworkUnknown = errors.New("network state unknown")
|
ErrNetworkUnknown = errors.New("network state unknown")
|
||||||
)
|
)
|
||||||
|
@ -85,13 +85,13 @@ func (s *runtimeState) runtimeErrors() error {
|
|||||||
defer s.RUnlock()
|
defer s.RUnlock()
|
||||||
errs := []error{}
|
errs := []error{}
|
||||||
if s.lastBaseRuntimeSync.IsZero() {
|
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()) {
|
} 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 {
|
for _, hc := range s.healthChecks {
|
||||||
if ok, err := hc.fn(); !ok {
|
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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user