1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/daemon/daemon_aufs.go
Stephen J Day b7f887a9a2 Move graph.SetupInitLayer to daemon package where it is used
An inspection of the graph package showed this function to be way out of place.
It is only depended upon by the daemon code. The function prepares a top-level
readonly layer used to provide a consistent runtime environment for docker
images.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-06-16 16:50:56 -07:00

21 lines
566 B
Go

// +build !exclude_graphdriver_aufs,linux
package daemon
import (
"github.com/Sirupsen/logrus"
"github.com/docker/docker/daemon/graphdriver"
"github.com/docker/docker/daemon/graphdriver/aufs"
)
// Given the graphdriver ad, if it is aufs, then migrate it.
// If aufs driver is not built, this func is a noop.
func migrateIfAufs(driver graphdriver.Driver, root string) error {
if ad, ok := driver.(*aufs.Driver); ok {
logrus.Debugf("Migrating existing containers")
if err := ad.Migrate(root, setupInitLayer); err != nil {
return err
}
}
return nil
}