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:
Justin Santa Barbara
2016-09-22 23:04:37 -04:00
parent b4e84d3e3b
commit f8eb179c2d
4 changed files with 20 additions and 6 deletions

View File

@@ -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 {