Merge pull request #97764 from pacoxu/fix/windows-cgroup

kubeadm should ignore cgroup driver check on Windows node
This commit is contained in:
Kubernetes Prow Robot 2021-01-19 22:18:11 -08:00 committed by GitHub
commit cff7d7ba0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ import (
"net/http" "net/http"
"path" "path"
"path/filepath" "path/filepath"
"runtime"
"sync" "sync"
"time" "time"
@ -254,6 +255,8 @@ func NewDockerService(config *ClientConfig, podSandboxImage string, streamingCon
ds.network = network.NewPluginManager(plug) ds.network = network.NewPluginManager(plug)
klog.Infof("Docker cri networking managed by %v", plug.Name()) klog.Infof("Docker cri networking managed by %v", plug.Name())
// skipping cgroup driver checks for Windows
if runtime.GOOS == "linux" {
// NOTE: cgroup driver is only detectable in docker 1.11+ // NOTE: cgroup driver is only detectable in docker 1.11+
cgroupDriver := defaultCgroupDriver cgroupDriver := defaultCgroupDriver
dockerInfo, err := ds.client.Info() dockerInfo, err := ds.client.Info()
@ -272,6 +275,8 @@ func NewDockerService(config *ClientConfig, podSandboxImage string, streamingCon
} }
klog.Infof("Setting cgroupDriver to %s", cgroupDriver) klog.Infof("Setting cgroupDriver to %s", cgroupDriver)
ds.cgroupDriver = cgroupDriver ds.cgroupDriver = cgroupDriver
}
ds.versionCache = cache.NewObjectCache( ds.versionCache = cache.NewObjectCache(
func() (interface{}, error) { func() (interface{}, error) {
return ds.getDockerVersion() return ds.getDockerVersion()