From 4e5e9dbec2313b07a4c10ddfd5bc7d23e3fa34f6 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 6 Nov 2019 21:36:18 +0100 Subject: mount: add new options nocopyup|copyup for tmpfs add a way to disable tmpcopyup for tmpfs. Signed-off-by: Giuseppe Scrivano --- pkg/spec/storage.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pkg/spec') diff --git a/pkg/spec/storage.go b/pkg/spec/storage.go index 095534589..e30bdfc67 100644 --- a/pkg/spec/storage.go +++ b/pkg/spec/storage.go @@ -514,11 +514,17 @@ func getTmpfsMount(args []string) (spec.Mount, error) { Source: TypeTmpfs, } - var setDest, setRORW, setSuid, setDev, setExec bool + var setDest, setRORW, setSuid, setDev, setExec, setTmpcopyup bool for _, val := range args { kv := strings.Split(val, "=") switch kv[0] { + case "tmpcopyup", "notmpcopyup": + if setTmpcopyup { + return newMount, errors.Wrapf(optionArgError, "cannot pass 'tmpcopyup' and 'notmpcopyup' options more than once") + } + setTmpcopyup = true + newMount.Options = append(newMount.Options, kv[0]) case "ro", "rw": if setRORW { return newMount, errors.Wrapf(optionArgError, "cannot pass 'ro' and 'rw' options more than once") -- cgit v1.2.3-54-g00ecf