mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-27 21:26:03 +00:00
Set runtimeState when RuntimeReady is not set or false
This commit is contained in:
@@ -30,6 +30,7 @@ type runtimeState struct {
|
||||
lastBaseRuntimeSync time.Time
|
||||
baseRuntimeSyncThreshold time.Duration
|
||||
networkError error
|
||||
runtimeError error
|
||||
storageError error
|
||||
cidr string
|
||||
healthChecks []*healthCheck
|
||||
@@ -62,6 +63,12 @@ func (s *runtimeState) setNetworkState(err error) {
|
||||
s.networkError = err
|
||||
}
|
||||
|
||||
func (s *runtimeState) setRuntimeState(err error) {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
s.runtimeError = err
|
||||
}
|
||||
|
||||
func (s *runtimeState) setStorageState(err error) {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
@@ -94,6 +101,9 @@ func (s *runtimeState) runtimeErrors() error {
|
||||
errs = append(errs, fmt.Errorf("%s is not healthy: %v", hc.name, err))
|
||||
}
|
||||
}
|
||||
if s.runtimeError != nil {
|
||||
errs = append(errs, s.runtimeError)
|
||||
}
|
||||
|
||||
return utilerrors.NewAggregate(errs)
|
||||
}
|
||||
|
Reference in New Issue
Block a user