Skip to content

Commit

Permalink
overlay: do not append empty option
Browse files Browse the repository at this point in the history
if d.options.mountOptions is the empty string, we should not append an
empty option.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Sep 13, 2023
1 parent 0c47206 commit f109925
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/overlay/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,9 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
needsIDMapping := !disableShifting && len(options.UidMaps) > 0 && len(options.GidMaps) > 0 && d.options.mountProgram == ""

if len(optsList) == 0 {
optsList = strings.Split(d.options.mountOptions, ",")
if d.options.mountOptions != "" {
optsList = strings.Split(d.options.mountOptions, ",")
}
} else {
// If metacopy=on is present in d.options.mountOptions it must be present in the mount
// options otherwise the kernel refuses to follow the metacopy xattr.
Expand Down

0 comments on commit f109925

Please sign in to comment.