mirror of
https://github.com/containers/podman.git
synced 2025-06-21 09:28:09 +08:00
pkg: support passing down options for idmap
[NO NEW TESTS NEEDED] the feature is still being worked in crun: https://github.com/containers/crun/pull/874 also needs: https://github.com/containers/common/pull/927 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -356,7 +356,11 @@ func getBindMount(args []string) (spec.Mount, error) {
|
|||||||
}
|
}
|
||||||
setOwnership = true
|
setOwnership = true
|
||||||
case "idmap":
|
case "idmap":
|
||||||
newMount.Options = append(newMount.Options, "idmap")
|
if len(kv) > 1 {
|
||||||
|
newMount.Options = append(newMount.Options, fmt.Sprintf("idmap=%s", kv[1]))
|
||||||
|
} else {
|
||||||
|
newMount.Options = append(newMount.Options, "idmap")
|
||||||
|
}
|
||||||
case "consistency":
|
case "consistency":
|
||||||
// Often used on MACs and mistakenly on Linux platforms.
|
// Often used on MACs and mistakenly on Linux platforms.
|
||||||
// Since Docker ignores this option so shall we.
|
// Since Docker ignores this option so shall we.
|
||||||
|
@ -45,14 +45,18 @@ func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch splitOpt[0] {
|
if strings.HasPrefix(splitOpt[0], "idmap") {
|
||||||
case "O":
|
|
||||||
foundOverlay = true
|
|
||||||
case "idmap":
|
|
||||||
if foundIdmap {
|
if foundIdmap {
|
||||||
return nil, errors.Wrapf(ErrDupeMntOption, "the 'idmap' option can only be set once")
|
return nil, errors.Wrapf(ErrDupeMntOption, "the 'idmap' option can only be set once")
|
||||||
}
|
}
|
||||||
foundIdmap = true
|
foundIdmap = true
|
||||||
|
newOptions = append(newOptions, opt)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
switch splitOpt[0] {
|
||||||
|
case "O":
|
||||||
|
foundOverlay = true
|
||||||
case "exec", "noexec":
|
case "exec", "noexec":
|
||||||
if foundExec {
|
if foundExec {
|
||||||
return nil, errors.Wrapf(ErrDupeMntOption, "only one of 'noexec' and 'exec' can be used")
|
return nil, errors.Wrapf(ErrDupeMntOption, "only one of 'noexec' and 'exec' can be used")
|
||||||
|
Reference in New Issue
Block a user