mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-27 21:26:03 +00:00
Create hostNetwork pods even if network plugin not ready
We do now admit pods (unlike the first attempt), but now we will stop non-hostnetwork pods from starting if the network is not ready. Issue #35409
This commit is contained in:
@@ -68,16 +68,13 @@ func (s *runtimeState) setInitError(err error) {
|
||||
s.initError = err
|
||||
}
|
||||
|
||||
func (s *runtimeState) errors() []string {
|
||||
func (s *runtimeState) runtimeErrors() []string {
|
||||
s.RLock()
|
||||
defer s.RUnlock()
|
||||
var ret []string
|
||||
if s.initError != nil {
|
||||
ret = append(ret, s.initError.Error())
|
||||
}
|
||||
if s.networkError != nil {
|
||||
ret = append(ret, s.networkError.Error())
|
||||
}
|
||||
if !s.lastBaseRuntimeSync.Add(s.baseRuntimeSyncThreshold).After(time.Now()) {
|
||||
ret = append(ret, "container runtime is down")
|
||||
}
|
||||
@@ -87,6 +84,16 @@ func (s *runtimeState) errors() []string {
|
||||
return ret
|
||||
}
|
||||
|
||||
func (s *runtimeState) networkErrors() []string {
|
||||
s.RLock()
|
||||
defer s.RUnlock()
|
||||
var ret []string
|
||||
if s.networkError != nil {
|
||||
ret = append(ret, s.networkError.Error())
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
func newRuntimeState(
|
||||
runtimeSyncThreshold time.Duration,
|
||||
) *runtimeState {
|
||||
|
Reference in New Issue
Block a user