Revert "Merge pull request #35821 from vishh/gci-mounter-scope"
This reverts commit973fa6b334
, reversing changes made to41b5fe86b6
.
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user