mirror of
https://github.com/containers/podman.git
synced 2025-10-26 02:35:43 +08:00
Vendor latest container/storage to fix overlay mountopt
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1160 Approved by: mheon
This commit is contained in:
committed by
Atomic Bot
parent
73e3945282
commit
9c806a4a3e
@ -11,7 +11,7 @@ github.com/containerd/continuity master
|
|||||||
github.com/containernetworking/cni v0.7.0-alpha1
|
github.com/containernetworking/cni v0.7.0-alpha1
|
||||||
github.com/containernetworking/plugins 1fb94a4222eafc6f948eacdca9c9f2158b427e53
|
github.com/containernetworking/plugins 1fb94a4222eafc6f948eacdca9c9f2158b427e53
|
||||||
github.com/containers/image c6e0eee0f8eb38e78ae2e44a9aeea0576f451617
|
github.com/containers/image c6e0eee0f8eb38e78ae2e44a9aeea0576f451617
|
||||||
github.com/containers/storage 8b1a0f8d6863cf05709af333b8997a437652ec4c
|
github.com/containers/storage afdedba2d2ad573350aee35033d4e0c58fdbd57b
|
||||||
github.com/containers/psgo 4ccd87a37eaec61a669da89ffacb0f79f3550943
|
github.com/containers/psgo 4ccd87a37eaec61a669da89ffacb0f79f3550943
|
||||||
github.com/coreos/go-systemd v14
|
github.com/coreos/go-systemd v14
|
||||||
github.com/cri-o/ocicni master
|
github.com/cri-o/ocicni master
|
||||||
|
|||||||
15
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
15
vendor/github.com/containers/storage/drivers/overlay/overlay.go
generated
vendored
@ -706,8 +706,11 @@ func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
|
|||||||
|
|
||||||
workDir := path.Join(dir, "work")
|
workDir := path.Join(dir, "work")
|
||||||
opts := fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", strings.Join(absLowers, ":"), diffDir, workDir)
|
opts := fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", strings.Join(absLowers, ":"), diffDir, workDir)
|
||||||
|
if d.options.mountOptions != "" {
|
||||||
|
opts = fmt.Sprintf("%s,%s", d.options.mountOptions, opts)
|
||||||
|
}
|
||||||
mountData := label.FormatMountLabel(opts, mountLabel)
|
mountData := label.FormatMountLabel(opts, mountLabel)
|
||||||
mount := unix.Mount
|
mountFunc := unix.Mount
|
||||||
mountTarget := mergedDir
|
mountTarget := mergedDir
|
||||||
|
|
||||||
pageSize := unix.Getpagesize()
|
pageSize := unix.Getpagesize()
|
||||||
@ -719,28 +722,26 @@ func (d *Driver) Get(id, mountLabel string) (_ string, retErr error) {
|
|||||||
if len(mountData) > pageSize || d.options.mountProgram != "" {
|
if len(mountData) > pageSize || d.options.mountProgram != "" {
|
||||||
//FIXME: We need to figure out to get this to work with additional stores
|
//FIXME: We need to figure out to get this to work with additional stores
|
||||||
opts = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", strings.Join(relLowers, ":"), path.Join(id, "diff"), path.Join(id, "work"))
|
opts = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", strings.Join(relLowers, ":"), path.Join(id, "diff"), path.Join(id, "work"))
|
||||||
if d.options.mountOptions != "" {
|
|
||||||
opts = fmt.Sprintf("%s,%s", d.options.mountOptions, opts)
|
|
||||||
}
|
|
||||||
mountData = label.FormatMountLabel(opts, mountLabel)
|
mountData = label.FormatMountLabel(opts, mountLabel)
|
||||||
if len(mountData) > pageSize {
|
if len(mountData) > pageSize {
|
||||||
return "", fmt.Errorf("cannot mount layer, mount label too large %d", len(mountData))
|
return "", fmt.Errorf("cannot mount layer, mount label too large %d", len(mountData))
|
||||||
}
|
}
|
||||||
|
|
||||||
if d.options.mountProgram != "" {
|
if d.options.mountProgram != "" {
|
||||||
mount = func(source string, target string, mType string, flags uintptr, label string) error {
|
mountFunc = func(source string, target string, mType string, flags uintptr, label string) error {
|
||||||
mountProgram := exec.Command(d.options.mountProgram, "-o", label, target)
|
mountProgram := exec.Command(d.options.mountProgram, "-o", label, target)
|
||||||
mountProgram.Dir = d.home
|
mountProgram.Dir = d.home
|
||||||
return mountProgram.Run()
|
return mountProgram.Run()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mount = func(source string, target string, mType string, flags uintptr, label string) error {
|
mountFunc = func(source string, target string, mType string, flags uintptr, label string) error {
|
||||||
return mountFrom(d.home, source, target, mType, flags, label)
|
return mountFrom(d.home, source, target, mType, flags, label)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mountTarget = path.Join(id, "merged")
|
mountTarget = path.Join(id, "merged")
|
||||||
}
|
}
|
||||||
if err := mount("overlay", mountTarget, "overlay", 0, mountData); err != nil {
|
flags, data := mount.ParseOptions(mountData)
|
||||||
|
if err := mountFunc("overlay", mountTarget, "overlay", uintptr(flags), data); err != nil {
|
||||||
return "", fmt.Errorf("error creating overlay mount to %s: %v", mountTarget, err)
|
return "", fmt.Errorf("error creating overlay mount to %s: %v", mountTarget, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
vendor/github.com/containers/storage/pkg/mount/flags.go
generated
vendored
6
vendor/github.com/containers/storage/pkg/mount/flags.go
generated
vendored
@ -111,9 +111,9 @@ func MergeTmpfsOptions(options []string) ([]string, error) {
|
|||||||
return newOptions, nil
|
return newOptions, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse fstab type mount options into mount() flags
|
// ParseOptions parses fstab type mount options into mount() flags
|
||||||
// and device specific data
|
// and device specific data
|
||||||
func parseOptions(options string) (int, string) {
|
func ParseOptions(options string) (int, string) {
|
||||||
var (
|
var (
|
||||||
flag int
|
flag int
|
||||||
data []string
|
data []string
|
||||||
@ -138,7 +138,7 @@ func parseOptions(options string) (int, string) {
|
|||||||
|
|
||||||
// ParseTmpfsOptions parse fstab type mount options into flags and data
|
// ParseTmpfsOptions parse fstab type mount options into flags and data
|
||||||
func ParseTmpfsOptions(options string) (int, string, error) {
|
func ParseTmpfsOptions(options string) (int, string, error) {
|
||||||
flags, data := parseOptions(options)
|
flags, data := ParseOptions(options)
|
||||||
for _, o := range strings.Split(data, ",") {
|
for _, o := range strings.Split(data, ",") {
|
||||||
opt := strings.SplitN(o, "=", 2)
|
opt := strings.SplitN(o, "=", 2)
|
||||||
if !validFlags[opt[0]] {
|
if !validFlags[opt[0]] {
|
||||||
|
|||||||
4
vendor/github.com/containers/storage/pkg/mount/mount.go
generated
vendored
4
vendor/github.com/containers/storage/pkg/mount/mount.go
generated
vendored
@ -39,7 +39,7 @@ func Mounted(mountpoint string) (bool, error) {
|
|||||||
// specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See
|
// specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See
|
||||||
// flags.go for supported option flags.
|
// flags.go for supported option flags.
|
||||||
func Mount(device, target, mType, options string) error {
|
func Mount(device, target, mType, options string) error {
|
||||||
flag, _ := parseOptions(options)
|
flag, _ := ParseOptions(options)
|
||||||
if flag&REMOUNT != REMOUNT {
|
if flag&REMOUNT != REMOUNT {
|
||||||
if mounted, err := Mounted(target); err != nil || mounted {
|
if mounted, err := Mounted(target); err != nil || mounted {
|
||||||
return err
|
return err
|
||||||
@ -53,7 +53,7 @@ func Mount(device, target, mType, options string) error {
|
|||||||
// specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See
|
// specified like the mount or fstab unix commands: "opt1=val1,opt2=val2". See
|
||||||
// flags.go for supported option flags.
|
// flags.go for supported option flags.
|
||||||
func ForceMount(device, target, mType, options string) error {
|
func ForceMount(device, target, mType, options string) error {
|
||||||
flag, data := parseOptions(options)
|
flag, data := ParseOptions(options)
|
||||||
return mount(device, target, mType, uintptr(flag), data)
|
return mount(device, target, mType, uintptr(flag), data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user