dockershim: add support for the 'nsenter' exec handler

This change simply plumbs the kubelet configuration
(--docker-exec-handler) to DockerService.
This commit is contained in:
Yu-Ju Hong 2017-01-19 16:23:48 -08:00
parent 80f3e93b9a
commit f9479ed84b
2 changed files with 4 additions and 6 deletions

View File

@ -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. // 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, 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) c := dockertools.NewInstrumentedDockerInterface(client)
ds := &dockerService{ ds := &dockerService{
seccompProfileRoot: seccompProfileRoot, seccompProfileRoot: seccompProfileRoot,
@ -111,9 +111,7 @@ func NewDockerService(client dockertools.DockerInterface, seccompProfileRoot str
podSandboxImage: podSandboxImage, podSandboxImage: podSandboxImage,
streamingRuntime: &streamingRuntime{ streamingRuntime: &streamingRuntime{
client: client, client: client,
// Only the native exec handling is supported for now. execHandler: execHandler,
// TODO(#35747) - Either deprecate nsenter exec handling, or add support for it here.
execHandler: &dockertools.NativeExecHandler{},
}, },
containerManager: cm.NewContainerManager(cgroupsName, client), containerManager: cm.NewContainerManager(cgroupsName, client),
} }

View File

@ -543,7 +543,7 @@ func NewMainKubelet(kubeCfg *componentconfig.KubeletConfiguration, kubeDeps *Kub
streamingConfig := getStreamingConfig(kubeCfg, kubeDeps) streamingConfig := getStreamingConfig(kubeCfg, kubeDeps)
// Use the new CRI shim for docker. // Use the new CRI shim for docker.
ds, err := dockershim.NewDockerService(klet.dockerClient, kubeCfg.SeccompProfileRoot, kubeCfg.PodInfraContainerImage, 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 { if err != nil {
return nil, err return nil, err
} }