From f9479ed84b13771d3828bd1fb116498f264c538d Mon Sep 17 00:00:00 2001 From: Yu-Ju Hong Date: Thu, 19 Jan 2017 16:23:48 -0800 Subject: [PATCH] dockershim: add support for the 'nsenter' exec handler This change simply plumbs the kubelet configuration (--docker-exec-handler) to DockerService. --- pkg/kubelet/dockershim/docker_service.go | 8 +++----- pkg/kubelet/kubelet.go | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/kubelet/dockershim/docker_service.go b/pkg/kubelet/dockershim/docker_service.go index 9635eaa7a128e..4ae881813e651 100644 --- a/pkg/kubelet/dockershim/docker_service.go +++ b/pkg/kubelet/dockershim/docker_service.go @@ -102,7 +102,7 @@ var internalLabelKeys []string = []string{containerTypeLabelKey, containerLogPat // NOTE: Anything passed to DockerService should be eventually handled in another way when we switch to running the shim as a different process. func NewDockerService(client dockertools.DockerInterface, seccompProfileRoot string, podSandboxImage string, streamingConfig *streaming.Config, - pluginSettings *NetworkPluginSettings, cgroupsName string, kubeCgroupDriver string) (DockerService, error) { + pluginSettings *NetworkPluginSettings, cgroupsName string, kubeCgroupDriver string, execHandler dockertools.ExecHandler) (DockerService, error) { c := dockertools.NewInstrumentedDockerInterface(client) ds := &dockerService{ seccompProfileRoot: seccompProfileRoot, @@ -110,10 +110,8 @@ func NewDockerService(client dockertools.DockerInterface, seccompProfileRoot str os: kubecontainer.RealOS{}, podSandboxImage: podSandboxImage, streamingRuntime: &streamingRuntime{ - client: client, - // Only the native exec handling is supported for now. - // TODO(#35747) - Either deprecate nsenter exec handling, or add support for it here. - execHandler: &dockertools.NativeExecHandler{}, + client: client, + execHandler: execHandler, }, containerManager: cm.NewContainerManager(cgroupsName, client), } diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 842235b5ff54f..5433904d7cd84 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -543,7 +543,7 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub streamingConfig := getStreamingConfig(kubeCfg, kubeDeps) // Use the new CRI shim for docker. ds, err := dockershim.NewDockerService(klet.dockerClient, kubeCfg.SeccompProfileRoot, kubeCfg.PodInfraContainerImage, - streamingConfig, &pluginSettings, kubeCfg.RuntimeCgroups, kubeCfg.CgroupDriver) + streamingConfig, &pluginSettings, kubeCfg.RuntimeCgroups, kubeCfg.CgroupDriver, dockerExecHandler) if err != nil { return nil, err }