MCPcopy Create free account
hub / github.com/containerd/nerdctl / mountsFromNative

Function mountsFromNative

pkg/inspecttypes/dockercompat/dockercompat.go:753–769  ·  view source on GitHub ↗

mountsFromNative only filters bind mount to transform from native container. Because native container shows all types of mounts, such as tmpfs, proc, sysfs.

(spMounts []specs.Mount)

Source from the content-addressed store, hash-verified

751// mountsFromNative only filters bind mount to transform from native container.
752// Because native container shows all types of mounts, such as tmpfs, proc, sysfs.
753func mountsFromNative(spMounts []specs.Mount) []MountPoint {
754 mountpoints := make([]MountPoint, 0, len(spMounts))
755 for _, m := range spMounts {
756 var mp MountPoint
757 if m.Type != "bind" {
758 continue
759 }
760 mp.Type = m.Type
761 mp.Source = m.Source
762 mp.Destination = m.Destination
763 mp.Mode = strings.Join(m.Options, ",")
764 mp.RW, mp.Propagation = ParseMountProperties(m.Options)
765 mountpoints = append(mountpoints, mp)
766 }
767
768 return mountpoints
769}
770
771func statusFromNative(x containerd.Status, labels map[string]string) string {
772 switch s := x.Status; s {

Callers 1

ContainerFromNativeFunction · 0.85

Calls 1

ParseMountPropertiesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…