use typeurl funcs for marshalling anypb.Any
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
This commit is contained in:
@@ -28,9 +28,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd/v2/pkg/atomicfile"
|
||||
"github.com/containerd/containerd/v2/pkg/dialer"
|
||||
"github.com/containerd/ttrpc"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/connectivity"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
@@ -40,6 +37,8 @@ import (
|
||||
"github.com/containerd/containerd/api/types"
|
||||
"github.com/containerd/containerd/v2/core/events/exchange"
|
||||
"github.com/containerd/containerd/v2/core/runtime"
|
||||
"github.com/containerd/containerd/v2/pkg/atomicfile"
|
||||
"github.com/containerd/containerd/v2/pkg/dialer"
|
||||
"github.com/containerd/containerd/v2/pkg/identifiers"
|
||||
"github.com/containerd/containerd/v2/pkg/protobuf"
|
||||
ptypes "github.com/containerd/containerd/v2/pkg/protobuf/types"
|
||||
@@ -47,6 +46,8 @@ import (
|
||||
"github.com/containerd/containerd/v2/pkg/timeout"
|
||||
"github.com/containerd/errdefs"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/ttrpc"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -564,7 +565,7 @@ func (s *shimTask) Create(ctx context.Context, opts runtime.CreateOpts) (runtime
|
||||
Stderr: opts.IO.Stderr,
|
||||
Terminal: opts.IO.Terminal,
|
||||
Checkpoint: opts.Checkpoint,
|
||||
Options: protobuf.FromAny(topts),
|
||||
Options: typeurl.MarshalProto(topts),
|
||||
}
|
||||
for _, m := range opts.Rootfs {
|
||||
request.Rootfs = append(request.Rootfs, &types.Mount{
|
||||
|
||||
@@ -26,10 +26,6 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
|
||||
"github.com/containerd/containerd/v2/core/containers"
|
||||
"github.com/containerd/containerd/v2/core/events/exchange"
|
||||
"github.com/containerd/containerd/v2/core/metadata"
|
||||
@@ -37,11 +33,14 @@ import (
|
||||
"github.com/containerd/containerd/v2/core/sandbox"
|
||||
"github.com/containerd/containerd/v2/internal/cleanup"
|
||||
"github.com/containerd/containerd/v2/pkg/namespaces"
|
||||
"github.com/containerd/containerd/v2/pkg/protobuf"
|
||||
shimbinary "github.com/containerd/containerd/v2/pkg/shim"
|
||||
"github.com/containerd/containerd/v2/pkg/timeout"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
"github.com/containerd/containerd/v2/version"
|
||||
"github.com/containerd/log"
|
||||
"github.com/containerd/plugin"
|
||||
"github.com/containerd/plugin/registry"
|
||||
"github.com/containerd/typeurl/v2"
|
||||
)
|
||||
|
||||
// ShimConfig for the shim
|
||||
@@ -256,7 +255,7 @@ func (m *ShimManager) startShim(ctx context.Context, bundle *Bundle, id string,
|
||||
ttrpcAddress: m.containerdTTRPCAddress,
|
||||
env: m.env,
|
||||
})
|
||||
shim, err := b.Start(ctx, protobuf.FromAny(topts), func() {
|
||||
shim, err := b.Start(ctx, typeurl.MarshalProto(topts), func() {
|
||||
log.G(ctx).WithField("id", id).Info("shim disconnected")
|
||||
|
||||
cleanupAfterDeadShim(cleanup.Background(ctx), id, m.shims, m.events, b)
|
||||
|
||||
@@ -37,7 +37,6 @@ import (
|
||||
|
||||
"github.com/containerd/containerd/v2/core/runtime"
|
||||
"github.com/containerd/containerd/v2/internal/cleanup"
|
||||
"github.com/containerd/containerd/v2/pkg/protobuf"
|
||||
"github.com/containerd/containerd/v2/pkg/protobuf/proto"
|
||||
"github.com/containerd/containerd/v2/pkg/timeout"
|
||||
"github.com/containerd/containerd/v2/plugins"
|
||||
@@ -272,7 +271,7 @@ func (m *TaskManager) validateRuntimeFeatures(ctx context.Context, opts runtime.
|
||||
topts = opts.RuntimeOptions
|
||||
}
|
||||
|
||||
pInfo, err := m.PluginInfo(ctx, &apitypes.RuntimeRequest{RuntimePath: opts.Runtime, Options: protobuf.FromAny(topts)})
|
||||
pInfo, err := m.PluginInfo(ctx, &apitypes.RuntimeRequest{RuntimePath: opts.Runtime, Options: typeurl.MarshalProto(topts)})
|
||||
if err != nil {
|
||||
return fmt.Errorf("runtime info: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user