summaryrefslogtreecommitdiff
path: root/pkg/util
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-06-13 11:28:24 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-06-13 15:32:45 +0200
commit23efe4cb819b9fb306155ab25db7e2459aba63bb (patch)
tree03b9943dfd5a36e942be6f2ca46a84daf0408d2e /pkg/util
parent97f4818ce1e09dd56dc2be820930924e870827e9 (diff)
downloadpodman-23efe4cb819b9fb306155ab25db7e2459aba63bb.tar.gz
podman-23efe4cb819b9fb306155ab25db7e2459aba63bb.tar.bz2
podman-23efe4cb819b9fb306155ab25db7e2459aba63bb.zip
storage: support --mount type=bind,bind-nonrecursive
add support for not recursive bind mounts. Closes: https://github.com/containers/libpod/issues/3314 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/util')
-rw-r--r--pkg/util/mountOpts.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/pkg/util/mountOpts.go b/pkg/util/mountOpts.go
index 59459807c..489e7eeef 100644
--- a/pkg/util/mountOpts.go
+++ b/pkg/util/mountOpts.go
@@ -17,10 +17,19 @@ var (
// sensible and follow convention.
func ProcessOptions(options []string) []string {
var (
- foundrw, foundro bool
- rootProp string
+ foundbind, foundrw, foundro bool
+ rootProp string
)
- options = append(options, "rbind")
+ for _, opt := range options {
+ switch opt {
+ case "bind", "rbind":
+ foundbind = true
+ break
+ }
+ }
+ if !foundbind {
+ options = append(options, "rbind")
+ }
for _, opt := range options {
switch opt {
case "rw":