Files
skopeo/mount.go
Nalin Dahyabhai 20f2cb9dbe Fix a number of issues flagged by golint
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2017-02-10 14:46:09 -05:00

29 lines
565 B
Go

package buildah
// Mount mounts a container's root filesystem in a location which can be
// accessed from the host, and returns the location.
func (b *Builder) Mount(label string) (string, error) {
mountpoint, err := b.store.Mount(b.ContainerID, label)
if err != nil {
return "", err
}
b.MountPoint = mountpoint
present := false
for _, m := range b.Mounts {
if m == mountpoint {
present = true
break
}
}
if !present {
b.Mounts = append(b.Mounts, mountpoint)
}
err = b.Save()
if err != nil {
return "", err
}
return mountpoint, nil
}