summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/util/mountOpts.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/pkg/util/mountOpts.go b/pkg/util/mountOpts.go
index 959763dba..f32cf6ea6 100644
--- a/pkg/util/mountOpts.go
+++ b/pkg/util/mountOpts.go
@@ -25,16 +25,30 @@ type defaultMountOptions struct {
// The sourcePath variable, if not empty, contains a bind mount source.
func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string, error) {
var (
- foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU bool
+ foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU, foundOverlay bool
)
newOptions := make([]string, 0, len(options))
for _, opt := range options {
// Some options have parameters - size, mode
splitOpt := strings.SplitN(opt, "=", 2)
+
+ // add advanced options such as upperdir=/path and workdir=/path, when overlay is specified
+ if foundOverlay {
+ if strings.Contains(opt, "upperdir") {
+ newOptions = append(newOptions, opt)
+ continue
+ }
+ if strings.Contains(opt, "workdir") {
+ newOptions = append(newOptions, opt)
+ continue
+ }
+ }
+
switch splitOpt[0] {
- case "idmap":
case "O":
+ foundOverlay = true
+ case "idmap":
if len(options) > 1 {
return nil, errors.Wrapf(ErrDupeMntOption, "'O' option can not be used with other options")
}