Merge pull request #10164 from henry118/shim-fix

Update ctr shim subcommand to task v3
This commit is contained in:
Maksym Pavlenko 2024-05-03 19:37:36 +00:00 committed by GitHub
commit b6ffa2794e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,7 +28,7 @@ import (
"strings" "strings"
"github.com/containerd/console" "github.com/containerd/console"
"github.com/containerd/containerd/api/runtime/task/v2" "github.com/containerd/containerd/api/runtime/task/v3"
"github.com/containerd/containerd/v2/cmd/ctr/commands" "github.com/containerd/containerd/v2/cmd/ctr/commands"
"github.com/containerd/containerd/v2/pkg/namespaces" "github.com/containerd/containerd/v2/pkg/namespaces"
ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types" ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types"
@ -232,7 +232,7 @@ var execCommand = &cli.Command{
}, },
} }
func getTaskService(context *cli.Context) (task.TaskService, error) { func getTaskService(context *cli.Context) (task.TTRPCTaskService, error) {
id := context.String("id") id := context.String("id")
if id == "" { if id == "" {
return nil, fmt.Errorf("container id must be specified") return nil, fmt.Errorf("container id must be specified")
@ -255,7 +255,7 @@ func getTaskService(context *cli.Context) (task.TaskService, error) {
// TODO(stevvooe): This actually leaks the connection. We were leaking it // TODO(stevvooe): This actually leaks the connection. We were leaking it
// before, so may not be a huge deal. // before, so may not be a huge deal.
return task.NewTaskClient(client), nil return task.NewTTRPCTaskClient(client), nil
} }
} }