Make ReadOnly() available on all platforms
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
parent
7bb2756bc4
commit
ba74cdf150
@ -68,6 +68,17 @@ func UnmountMounts(mounts []Mount, target string, flags int) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ReadOnly returns a boolean value indicating whether this mount has the "ro"
|
||||
// option set.
|
||||
func (m *Mount) ReadOnly() bool {
|
||||
for _, option := range m.Options {
|
||||
if option == "ro" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Mount to the provided target path.
|
||||
func (m *Mount) Mount(target string) error {
|
||||
target, err := fs.RootPath(target, m.Target)
|
||||
|
@ -38,15 +38,6 @@ var (
|
||||
ErrNotImplementOnWindows = errors.New("not implemented under windows")
|
||||
)
|
||||
|
||||
func (m *Mount) ReadOnly() bool {
|
||||
for _, option := range m.Options {
|
||||
if option == "ro" {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Mount to the provided target.
|
||||
func (m *Mount) mount(target string) (retErr error) {
|
||||
if m.Type != "windows-layer" {
|
||||
|
Loading…
Reference in New Issue
Block a user