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
@@ -114,7 +114,7 @@ func (l *local) Create(ctx context.Context, r *api.CreateTaskRequest, _ ...grpc.
|
||||
err error
|
||||
)
|
||||
if r.Checkpoint != nil {
|
||||
checkpointPath, err = ioutil.TempDir("", "ctrd-checkpoint")
|
||||
checkpointPath, err = ioutil.TempDir(os.Getenv("XDG_RUNTIME_DIR"), "ctrd-checkpoint")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -450,7 +450,7 @@ func (l *local) Checkpoint(ctx context.Context, r *api.CheckpointTaskRequest, _
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
image, err := ioutil.TempDir("", "ctd-checkpoint")
|
||||
image, err := ioutil.TempDir(os.Getenv("XDG_RUNTIME_DIR"), "ctd-checkpoint")
|
||||
if err != nil {
|
||||
return nil, errdefs.ToGRPC(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user