فهرست منبع

Revert "add a -mount-method flag"

This reverts commit e52d756f40c9ccf8b37ca496cb72be057c909ed7.
Victor Vieux 11 سال پیش
والد
کامیت
5e1d540209
5فایلهای تغییر یافته به همراه11 افزوده شده و 20 حذف شده
  1. 3 4
      docker/docker.go
  2. 3 11
      runtime.go
  3. 2 2
      runtime_test.go
  4. 2 2
      server.go
  5. 1 1
      utils_test.go

+ 3 - 4
docker/docker.go

@@ -36,7 +36,6 @@ func main() {
 	flGraphPath := flag.String("g", "/var/lib/docker", "Path to graph storage base dir.")
 	flEnableCors := flag.Bool("api-enable-cors", false, "Enable CORS requests in the remote api.")
 	flDns := flag.String("dns", "", "Set custom dns servers")
-	flMountMethod := flag.String("mount-method", "", "Set the mount method to use, default is auto. [aufs, devicemapper, filesystem]")
 	flHosts := docker.ListOpts{fmt.Sprintf("unix://%s", docker.DEFAULTUNIXSOCKET)}
 	flag.Var(&flHosts, "H", "tcp://host:port to bind/connect to or unix://path/to/socket to use")
 	flag.Parse()
@@ -66,7 +65,7 @@ func main() {
 			flag.Usage()
 			return
 		}
-		if err := daemon(*pidfile, *flGraphPath, flHosts, *flAutoRestart, *flEnableCors, *flDns, *flMountMethod); err != nil {
+		if err := daemon(*pidfile, *flGraphPath, flHosts, *flAutoRestart, *flEnableCors, *flDns); err != nil {
 			log.Fatal(err)
 			os.Exit(-1)
 		}
@@ -117,7 +116,7 @@ func removePidFile(pidfile string) {
 	}
 }
 
-func daemon(pidfile string, flGraphPath string, protoAddrs []string, autoRestart, enableCors bool, flDns, mountMethod  string) error {
+func daemon(pidfile string, flGraphPath string, protoAddrs []string, autoRestart, enableCors bool, flDns string) error {
 	if err := createPidFile(pidfile); err != nil {
 		log.Fatal(err)
 	}
@@ -135,7 +134,7 @@ func daemon(pidfile string, flGraphPath string, protoAddrs []string, autoRestart
 	if flDns != "" {
 		dns = []string{flDns}
 	}
-	server, err := docker.NewServer(flGraphPath, devmapper.NewDeviceSetDM(flGraphPath), autoRestart, enableCors, dns, mountMethod)
+	server, err := docker.NewServer(flGraphPath, devmapper.NewDeviceSetDM(flGraphPath), autoRestart, enableCors, dns)
 	if err != nil {
 		return err
 	}

+ 3 - 11
runtime.go

@@ -518,8 +518,8 @@ func (runtime *Runtime) Commit(container *Container, repository, tag, comment, a
 }
 
 // FIXME: harmonize with NewGraph()
-func NewRuntime(flGraphPath string, deviceSet DeviceSet, autoRestart bool, dns []string, mountMethod string) (*Runtime, error) {
-	runtime, err := NewRuntimeFromDirectory(flGraphPath, deviceSet, autoRestart, mountMethod)
+func NewRuntime(flGraphPath string, deviceSet DeviceSet, autoRestart bool, dns []string) (*Runtime, error) {
+	runtime, err := NewRuntimeFromDirectory(flGraphPath, deviceSet, autoRestart)
 	if err != nil {
 		return nil, err
 	}
@@ -537,7 +537,7 @@ func NewRuntime(flGraphPath string, deviceSet DeviceSet, autoRestart bool, dns [
 	return runtime, nil
 }
 
-func NewRuntimeFromDirectory(root string, deviceSet DeviceSet, autoRestart bool, mountMethod string) (*Runtime, error) {
+func NewRuntimeFromDirectory(root string, deviceSet DeviceSet, autoRestart bool) (*Runtime, error) {
 	runtimeRepo := path.Join(root, "containers")
 
 	if err := os.MkdirAll(runtimeRepo, 0700); err != nil && !os.IsExist(err) {
@@ -577,14 +577,6 @@ func NewRuntimeFromDirectory(root string, deviceSet DeviceSet, autoRestart bool,
 		deviceSet:      deviceSet,
 	}
 
-	if mountMethod == "aufs" {
-		runtime.mountMethod = MountMethodAUFS
-	} else if mountMethod == "devicemapper" {
-		runtime.mountMethod = MountMethodDeviceMapper
-	} else if mountMethod == "filesystem" {
-		runtime.mountMethod = MountMethodFilesystem
-	}
-
 	if err := runtime.restore(); err != nil {
 		return nil, err
 	}

+ 2 - 2
runtime_test.go

@@ -135,7 +135,7 @@ func init() {
 	}
 
 	// Make it our Store root
-	if runtime, err := NewRuntimeFromDirectory(unitTestStoreBase, devmapper.NewDeviceSetDM(unitTestStoreDevicesBase), false, ""); err != nil {
+	if runtime, err := NewRuntimeFromDirectory(unitTestStoreBase, devmapper.NewDeviceSetDM(unitTestStoreDevicesBase), false); err != nil {
 		panic(err)
 	} else {
 		globalRuntime = runtime
@@ -504,7 +504,7 @@ func TestRestore(t *testing.T) {
 
 	// Here are are simulating a docker restart - that is, reloading all containers
 	// from scratch
-	runtime2, err := NewRuntimeFromDirectory(runtime1.root, runtime1.deviceSet, false, "")
+	runtime2, err := NewRuntimeFromDirectory(runtime1.root, runtime1.deviceSet, false)
 	if err != nil {
 		t.Fatal(err)
 	}

+ 2 - 2
server.go

@@ -1294,11 +1294,11 @@ func (srv *Server) ContainerCopy(name string, resource string, out io.Writer) er
 
 }
 
-func NewServer(flGraphPath string, deviceSet DeviceSet, autoRestart, enableCors bool, dns ListOpts, mountMethod string) (*Server, error) {
+func NewServer(flGraphPath string, deviceSet DeviceSet, autoRestart, enableCors bool, dns ListOpts) (*Server, error) {
 	if runtime.GOARCH != "amd64" {
 		log.Fatalf("The docker runtime currently only supports amd64 (not %s). This will change in the future. Aborting.", runtime.GOARCH)
 	}
-	runtime, err := NewRuntime(flGraphPath, deviceSet, autoRestart, dns, mountMethod)
+	runtime, err := NewRuntime(flGraphPath, deviceSet, autoRestart, dns)
 	if err != nil {
 		return nil, err
 	}

+ 1 - 1
utils_test.go

@@ -43,7 +43,7 @@ func newTestRuntime() (*Runtime, error) {
 		return nil, err
 	}
 
-	runtime, err := NewRuntimeFromDirectory(root, NewDeviceSetWrapper (globalRuntime.deviceSet, filepath.Base(root)), false)
+	runtime, err := NewRuntimeFromDirectory(root, NewDeviceSetWrapper(globalRuntime.deviceSet, filepath.Base(root)), false)
 	if err != nil {
 		return nil, err
 	}