mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
b7f887a9a2
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>
21 lines
566 B
Go
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
|
|
}
|