Call temp mounts and unmount in containerd server
Fixes #2004 Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -12,6 +12,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"
|
||||
@@ -95,6 +96,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")
|
||||
|
||||
Reference in New Issue
Block a user