MCPcopy
hub / github.com/containerd/containerd / List

Method List

core/mount/manager/manager.go:830–855  ·  view source on GitHub ↗
(ctx context.Context, filters ...string)

Source from the content-addressed store, hash-verified

828}
829
830func (mm *mountManager) List(ctx context.Context, filters ...string) ([]mount.ActivationInfo, error) {
831 namespace, err := namespaces.NamespaceRequired(ctx)
832 if err != nil {
833 return nil, err
834 }
835
836 var infos []mount.ActivationInfo
837 if err := mm.db.View(func(tx *bolt.Tx) error {
838 mbkt := getBucket(tx, []byte("v1"), []byte(namespace), bucketKeyMounts)
839 if mbkt == nil {
840 return nil
841 }
842
843 return mbkt.ForEachBucket(func(k []byte) error {
844 info, err := readActivationInfo(string(k), mbkt.Bucket(k))
845 if err != nil {
846 return err
847 }
848 infos = append(infos, info)
849 return nil
850 })
851 }); err != nil {
852 return nil, err
853 }
854 return infos, nil
855}
856
857func (mm *mountManager) StartCollection(ctx context.Context) (metadata.CollectionContext, error) {
858 // lock now and collection will unlock on cancel or finish

Callers

nothing calls this directly

Calls 4

NamespaceRequiredFunction · 0.92
readActivationInfoFunction · 0.85
getBucketFunction · 0.70
ViewMethod · 0.65

Tested by

no test coverage detected