mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Only try to connect to docker if we're actually using the docker runtime
This commit is contained in:
parent
f277205f4f
commit
0afaeab9b1
@ -124,12 +124,19 @@ func UnsecuredKubeletDeps(s *options.KubeletServer) (*kubelet.KubeletDeps, error
|
||||
writer = &kubeio.NsenterWriter{}
|
||||
}
|
||||
|
||||
var dockerClient dockertools.DockerInterface
|
||||
if s.ContainerRuntime == "docker" {
|
||||
dockerClient = dockertools.ConnectToDockerOrDie(s.DockerEndpoint, s.RuntimeRequestTimeout.Duration)
|
||||
} else {
|
||||
dockerClient = nil
|
||||
}
|
||||
|
||||
return &kubelet.KubeletDeps{
|
||||
Auth: nil, // default does not enforce auth[nz]
|
||||
CAdvisorInterface: nil, // cadvisor.New launches background processes (bg http.ListenAndServe, and some bg cleaners), not set here
|
||||
Cloud: nil, // cloud provider might start background processes
|
||||
ContainerManager: nil,
|
||||
DockerClient: dockertools.ConnectToDockerOrDie(s.DockerEndpoint, s.RuntimeRequestTimeout.Duration), // TODO(random-liu): Set RuntimeRequestTimeout for rkt.
|
||||
DockerClient: dockerClient,
|
||||
KubeClient: nil,
|
||||
Mounter: mounter,
|
||||
NetworkPlugins: ProbeNetworkPlugins(s.NetworkPluginDir),
|
||||
|
Loading…
Reference in New Issue
Block a user