diff --git a/core/runtime/v2/shim_manager.go b/core/runtime/v2/shim_manager.go index 09e15c3368..ce69928e8a 100644 --- a/core/runtime/v2/shim_manager.go +++ b/core/runtime/v2/shim_manager.go @@ -26,7 +26,6 @@ import ( "strings" "sync" - apitypes "github.com/containerd/containerd/api/types" "github.com/containerd/errdefs" "github.com/containerd/log" "github.com/containerd/plugin" @@ -185,8 +184,6 @@ type ShimManager struct { // runtimePaths is a cache of `runtime names` -> `resolved fs path` runtimePaths sync.Map sandboxStore sandbox.Store - // shimInfos is a cache of the shim info - shimInfos sync.Map } // ID of the shim manager @@ -483,40 +480,3 @@ func (m *ShimManager) Delete(ctx context.Context, id string) error { return err } - -type shimInfo struct { - handledMounts []string -} - -func (m *ShimManager) loadShimInfo(ctx context.Context, shim string) (*shimInfo, error) { - if i, ok := m.shimInfos.Load(shim); ok { - return i.(*shimInfo), nil - } - // Avoid fetching info for default shims with known behavior - if shim == "io.containerd.runc.v2" || shim == "io.containerd.runhcs.v1" { - sinfo := &shimInfo{} - m.shimInfos.Store(shim, sinfo) - return sinfo, nil - } - - rinfo, err := getRuntimeInfo(ctx, m, &apitypes.RuntimeRequest{RuntimePath: shim}) - if err != nil { - return nil, err - } - sinfo := &shimInfo{} - - if rinfo.Annotations != nil { - if v, ok := rinfo.Annotations[allowedMounts]; ok { - sinfo.handledMounts = strings.Split(v, ",") - } - } - - fields := log.Fields{} - for k, v := range rinfo.Annotations { - fields[k] = v - } - log.G(ctx).WithFields(fields).WithField("shim", shim).Debug("loaded shim info") - - m.shimInfos.Store(shim, sinfo) - return sinfo, nil -} diff --git a/core/runtime/v2/task_manager.go b/core/runtime/v2/task_manager.go index fbc2291b16..ba6d121c65 100644 --- a/core/runtime/v2/task_manager.go +++ b/core/runtime/v2/task_manager.go @@ -46,13 +46,6 @@ import ( "github.com/containerd/containerd/v2/plugins/services/warning" ) -const ( - // allowedMounts are the custom mount types allowed by the runtime. These - // types should not be handled by the mount manager. - // To include prepare mount types, use "/*" suffix, such as "format/*" - allowedMounts = "containerd.io/runtime-allow-mounts" -) - // TaskConfig for the runtime task manager type TaskConfig struct { // Supported platforms @@ -177,13 +170,6 @@ func (m *TaskManager) Create(ctx context.Context, taskID string, opts runtime.Cr "containerd.io/gc.bref.container": taskID, }), } - if info, err := m.manager.loadShimInfo(ctx, opts.Runtime); err == nil { - for _, t := range info.handledMounts { - activateOpts = append(activateOpts, mount.WithAllowMountType(t)) - } - } else { - log.G(ctx).WithError(err).WithField("runtime", opts.Runtime).Error("failed to load runtime info") - } // Add options based on runtime if ai, err := m.mounts.Activate(ctx, taskID, opts.Rootfs, activateOpts...); err == nil {