Jelajahi Sumber

Daemon: do GetRWLayer after checking if container use the current graph driver

Signed-off-by: Lei Jitang <leijitang@huawei.com>
Lei Jitang 9 tahun lalu
induk
melakukan
899f1b1870
1 mengubah file dengan 6 tambahan dan 7 penghapusan
  1. 6 7
      daemon/daemon.go

+ 6 - 7
daemon/daemon.go

@@ -277,15 +277,14 @@ func (daemon *Daemon) restore() error {
 			continue
 			continue
 		}
 		}
 
 
-		rwlayer, err := daemon.layerStore.GetRWLayer(container.ID)
-		if err != nil {
-			logrus.Errorf("Failed to load container mount %v: %v", id, err)
-			continue
-		}
-		container.RWLayer = rwlayer
-
 		// Ignore the container if it does not support the current driver being used by the graph
 		// Ignore the container if it does not support the current driver being used by the graph
 		if (container.Driver == "" && currentDriver == "aufs") || container.Driver == currentDriver {
 		if (container.Driver == "" && currentDriver == "aufs") || container.Driver == currentDriver {
+			rwlayer, err := daemon.layerStore.GetRWLayer(container.ID)
+			if err != nil {
+				logrus.Errorf("Failed to load container mount %v: %v", id, err)
+				continue
+			}
+			container.RWLayer = rwlayer
 			logrus.Debugf("Loaded container %v", container.ID)
 			logrus.Debugf("Loaded container %v", container.ID)
 
 
 			containers[container.ID] = container
 			containers[container.ID] = container