Add ReadOnly() function

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira
2023-04-01 08:43:14 -07:00
parent 4012c1b853
commit 7f82dd91f4
2 changed files with 9 additions and 16 deletions

View File

@@ -335,15 +335,7 @@ func mountsToLayerAndParents(mounts []mount.Mount) (string, []string, error) {
return "", nil, err
}
isView := false
for _, o := range mnt.Options {
if o == "ro" {
isView = true
break
}
}
if isView {
if mnt.ReadOnly() {
if mnt.Type == "bind" && len(parentLayerPaths) != 0 {
return "", nil, fmt.Errorf("unexpected bind-mount View with parents: %w", errdefs.ErrInvalidArgument)
} else if mnt.Type == "bind" {