2016-11-30 00:08:30 +00:00
|
|
|
package containerd
|
2016-09-27 01:15:19 +00:00
|
|
|
|
2016-12-14 14:34:25 +00:00
|
|
|
// Mount is the lingua franca of containerd. A mount represents a
|
2016-09-27 01:15:19 +00:00
|
|
|
// serialized mount syscall. Components either emit or consume mounts.
|
|
|
|
type Mount struct {
|
|
|
|
// Type specifies the host-specific of the mount.
|
|
|
|
Type string
|
|
|
|
// Source specifies where to mount from. Depending on the host system, this
|
|
|
|
// can be a source path or device.
|
|
|
|
Source string
|
|
|
|
// Options contains zero or more fstab-style mount options. Typically,
|
|
|
|
// these are platform specific.
|
|
|
|
Options []string
|
|
|
|
}
|
2016-09-27 04:35:34 +00:00
|
|
|
|
2017-01-17 21:26:56 +00:00
|
|
|
// MountAll mounts all the provided mounts to the provided target
|
|
|
|
func MountAll(mounts []Mount, target string) error {
|
2016-12-09 19:27:30 +00:00
|
|
|
for _, m := range mounts {
|
2017-01-17 21:26:56 +00:00
|
|
|
if err := m.Mount(target); err != nil {
|
2016-12-09 19:27:30 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|