Merge pull request #2112 from crosbymichael/temp-mounts

Add temp mount location to manage temp mounts
This commit is contained in:
Derek McGowan
2018-02-21 12:56:23 -08:00
committed by GitHub
5 changed files with 119 additions and 48 deletions

View File

@@ -28,6 +28,7 @@ import (
"time"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/server"
"github.com/containerd/containerd/sys"
"github.com/containerd/containerd/version"
@@ -111,6 +112,14 @@ func App() *cli.App {
if err := applyFlags(context, config); err != nil {
return err
}
// cleanup temp mounts
if err := mount.SetTempMountLocation(filepath.Join(config.Root, "tmpmounts")); err != nil {
return errors.Wrap(err, "creating temp mount location")
}
// unmount all temp mounts on boot for the server
if err := mount.CleanupTempMounts(0); err != nil {
return errors.Wrap(err, "unmounting temp mounts")
}
address := config.GRPC.Address
if address == "" {
return errors.New("grpc address cannot be empty")