Revert "Merge pull request #35821 from vishh/gci-mounter-scope"

This reverts commit 973fa6b334, reversing
changes made to 41b5fe86b6.
This commit is contained in:
saadali
2016-11-03 20:23:25 -07:00
parent b4e84d3e3b
commit 402116aed4
22 changed files with 3296 additions and 3233 deletions

View File

@@ -30,7 +30,7 @@ import (
const (
// Default mount command if mounter path is not specified
defaultMountCommand = "mount"
mount = "mount"
)
type Interface interface {
@@ -94,16 +94,25 @@ func (mounter *SafeFormatAndMount) FormatAndMount(source string, target string,
}
// New returns a mount.Interface for the current system.
func New() Interface {
return &Mounter{}
}
// NewCustomMounter returns a mount.Interface for the current system.
// It provides options to override the default mounter behavior.
// mounterPath allows using an alternative to `/bin/mount` for mounting.
func New(mounterPath string) Interface {
// mounterRootfsPath allows specifying a custom root filesystem path for non default `mounterPath`.
func NewCustomMounter(mounterPath, mounterRootfsPath string) Interface {
// If mounter-path flag is not set, use default mount path
if mounterPath == "" {
mounterPath = defaultMountCommand
mounterPath = mount
}
if mounterRootfsPath == "" {
mounterRootfsPath = "/"
}
return &Mounter{
mounterPath: mounterPath,
mounterPath: mounterPath,
mounterRootfsPath: mounterRootfsPath,
}
}