CreateTaskRequest options switch missing case for *runctypes.CreateOptions #19
Comments
PR: #20 |
@jmillikin-stripe Are you using With "Kubernetes + containerd", |
I'm using it with containerd directly, not via Kubernetes or CRI. It works fine except for this one particular missing type assertion, and the referenced PR does work for the subset of |
@jmillikin-stripe can you share your config.toml? Also, what exactly are you doing to get this error? I suppose you are creating a container via the containerd API rather than CRI? |
@Random-Liu I think the relevant code is here since it's 1.2.x. In this case there aren't any runtime checks since it wasn't implemented yet. I feel like we should probably handle this case. |
I'm using the containerd API directly. The config.toml file has no effect on this behavior; the reproduction is in the following client code: var stdout, stderr bytes.Buffer
task, err := container.NewTask(
containerCtx,
cio.NewCreator(
cio.WithFIFODir(fifoDir),
cio.WithStreams(
nil, // stdin
&stdout,
&stderr,
),
),
containerd.WithNoNewKeyring,
) The |
No wonder. That's what I guessed. :)
I'm fine with handling that :) |
When ContainerD v1.2.4 creates a task, it may pass a *runctypes.CreateOptions in the request options field. This currently causes the gvisor-containerd-shim to reject the request. This PR allows the shim to handle requests with creation options set, and also slightly improves the error message so future failures of this kind are easier to localize to the shim. Fixes #19
In pkg/v2/service.go the
Create()
handler has a switch on option types. This switch is not handling one of the types that ContainerD 1.2.4 can produce,*runctypes.CreateOptions
.Additionally, the error message
unsupported option type
is extremely vague in that it doesn't indicate what part of the system the error comes from, or what the cause is.The text was updated successfully, but these errors were encountered: