Merge pull request #84649 from benmoss/windows_network_not_initialized

Skip GetPodNetworkStatus when CNI not yet initialized
This commit is contained in:
Kubernetes Prow Robot
2019-11-13 09:25:59 -08:00
committed by GitHub

View File

@@ -45,6 +45,10 @@ func (plugin *cniNetworkPlugin) GetPodNetworkStatus(namespace string, name strin
return nil, fmt.Errorf("CNI failed to retrieve network namespace path: %v", err)
}
if plugin.getDefaultNetwork() == nil {
return nil, fmt.Errorf("CNI network not yet initialized, skipping pod network status for container %q", id)
}
// Because the default remote runtime request timeout is 4 min,so set slightly less than 240 seconds
// Todo get the timeout from parent ctx
cniTimeoutCtx, cancelFunc := context.WithTimeout(context.Background(), network.CNITimeoutSec*time.Second)