MCPcopy
hub / github.com/containerd/containerd / Activate

Method Activate

plugins/services/mounts/service.go:65–83  ·  view source on GitHub ↗
(ctx context.Context, in *api.ActivateRequest)

Source from the content-addressed store, hash-verified

63}
64
65func (s *service) Activate(ctx context.Context, in *api.ActivateRequest) (*api.ActivateResponse, error) {
66 log.G(ctx).WithFields(log.Fields{"name": in.Name, "temp": in.Temporary, "mounts": len(in.Mounts)}).Debug("activate mounts")
67 var opts []mount.ActivateOpt
68 if in.Temporary {
69 opts = append(opts, mount.WithTemporary)
70 }
71 if in.Labels != nil {
72 opts = append(opts, mount.WithLabels(in.Labels))
73 }
74
75 info, err := s.mm.Activate(ctx, in.Name, mount.FromProto(in.Mounts), opts...)
76 if err != nil {
77 return nil, errgrpc.ToGRPC(err)
78 }
79 return &api.ActivateResponse{
80 Info: proxy.ActivationInfoToProto(info),
81 }, nil
82
83}
84
85func (s *service) Deactivate(ctx context.Context, in *api.DeactivateRequest) (*emptypb.Empty, error) {
86 log.G(ctx).WithField("name", in.Name).Debug("deactivate mounts")

Callers

nothing calls this directly

Calls 4

WithLabelsFunction · 0.92
FromProtoFunction · 0.92
ActivationInfoToProtoFunction · 0.92
ActivateMethod · 0.65

Tested by

no test coverage detected