mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Add a special-cased runtime handler for dockershim
This commit is contained in:
parent
1fba88884b
commit
19a588eeda
@ -96,7 +96,7 @@ func (ds *dockerService) RunPodSandbox(ctx context.Context, r *runtimeapi.RunPod
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Step 2: Create the sandbox container.
|
// Step 2: Create the sandbox container.
|
||||||
if r.GetRuntimeHandler() != "" {
|
if r.GetRuntimeHandler() != "" && r.GetRuntimeHandler() != runtimeName {
|
||||||
return nil, fmt.Errorf("RuntimeHandler %q not supported", r.GetRuntimeHandler())
|
return nil, fmt.Errorf("RuntimeHandler %q not supported", r.GetRuntimeHandler())
|
||||||
}
|
}
|
||||||
createConfig, err := ds.makeSandboxDockerConfig(config, image)
|
createConfig, err := ds.makeSandboxDockerConfig(config, image)
|
||||||
|
@ -38,6 +38,9 @@ const (
|
|||||||
// PreconfiguredRuntimeHandler is the name of the runtime handler that is expected to be
|
// PreconfiguredRuntimeHandler is the name of the runtime handler that is expected to be
|
||||||
// preconfigured in the test environment.
|
// preconfigured in the test environment.
|
||||||
PreconfiguredRuntimeHandler = "test-handler"
|
PreconfiguredRuntimeHandler = "test-handler"
|
||||||
|
// DockerRuntimeHandler is a hardcoded runtime handler that is accepted by dockershim, and
|
||||||
|
// treated equivalently to a nil runtime handler.
|
||||||
|
DockerRuntimeHandler = "docker"
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = Describe("[sig-node] RuntimeClass", func() {
|
var _ = Describe("[sig-node] RuntimeClass", func() {
|
||||||
@ -59,9 +62,12 @@ var _ = Describe("[sig-node] RuntimeClass", func() {
|
|||||||
// This test requires that the PreconfiguredRuntimeHandler has already been set up on nodes.
|
// This test requires that the PreconfiguredRuntimeHandler has already been set up on nodes.
|
||||||
It("should run a Pod requesting a RuntimeClass with a configured handler [NodeFeature:RuntimeHandler]", func() {
|
It("should run a Pod requesting a RuntimeClass with a configured handler [NodeFeature:RuntimeHandler]", func() {
|
||||||
// The built-in docker runtime does not support configuring runtime handlers.
|
// The built-in docker runtime does not support configuring runtime handlers.
|
||||||
framework.SkipIfContainerRuntimeIs("docker")
|
handler := PreconfiguredRuntimeHandler
|
||||||
|
if framework.TestContext.ContainerRuntime == "docker" {
|
||||||
|
handler = DockerRuntimeHandler
|
||||||
|
}
|
||||||
|
|
||||||
rcName := createRuntimeClass(f, "preconfigured-handler", PreconfiguredRuntimeHandler)
|
rcName := createRuntimeClass(f, "preconfigured-handler", handler)
|
||||||
pod := createRuntimeClassPod(f, rcName)
|
pod := createRuntimeClassPod(f, rcName)
|
||||||
expectPodSuccess(f, pod)
|
expectPodSuccess(f, pod)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user