From ca5605b4a208d9d5c809813adbec6b2227ab6c23 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Sat, 1 Apr 2023 08:49:24 -0700 Subject: [PATCH] Skip parent layer options on bind mounts Signed-off-by: Gabriel Adrian Samfira --- snapshots/windows/windows.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/snapshots/windows/windows.go b/snapshots/windows/windows.go index 25b87300a..0f35000a7 100644 --- a/snapshots/windows/windows.go +++ b/snapshots/windows/windows.go @@ -333,15 +333,19 @@ func (s *snapshotter) mounts(sn storage.Snapshot, key string) []mount.Mount { parentLayersJSON, _ := json.Marshal(parentLayerPaths) parentLayersOption := mount.ParentLayerPathsFlag + string(parentLayersJSON) - var mounts []mount.Mount - mounts = append(mounts, mount.Mount{ - Source: source, - Type: mountType, - Options: []string{ - roFlag, - parentLayersOption, + options := []string{ + roFlag, + } + if mountType != "bind" { + options = append(options, parentLayersOption) + } + mounts := []mount.Mount{ + { + Source: source, + Type: mountType, + Options: options, }, - }) + } return mounts }