Use user-specific temp directory if set
This allows non-privileged users to use containerd. This is part of a larger track of work integrating containerd into Cloudfoundry's garden with support for rootless. [#156343575] Signed-off-by: Claudia Beresford <cberesford@pivotal.io>
This commit is contained in:
committed by
Claudia Beresford
parent
40c3acd36c
commit
fc8bce59b9
@@ -75,7 +75,7 @@ func createInitLayer(ctx context.Context, parent, initName string, initFn func(s
|
||||
// TODO: ensure not exist error once added to snapshot package
|
||||
|
||||
// Create tempdir
|
||||
td, err := ioutil.TempDir("", "create-init-")
|
||||
td, err := ioutil.TempDir(os.Getenv("XDG_RUNTIME_DIR"), "create-init-")
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user