|
8 | 8 | "path/filepath" |
9 | 9 | "strings" |
10 | 10 |
|
11 | | - "github.com/Sirupsen/logrus" |
12 | 11 | "github.com/docker/docker/pkg/chrootarchive" |
13 | 12 | "github.com/docker/docker/runconfig" |
14 | 13 | "github.com/docker/docker/volume" |
@@ -291,37 +290,6 @@ func (daemon *Daemon) verifyVolumesInfo(container *Container) error { |
291 | 290 | return container.ToDisk() |
292 | 291 | } |
293 | 292 |
|
294 | | -// migrateVolume moves the contents of a volume created pre Docker 1.7 |
295 | | -// to the location expected by the local driver. Steps: |
296 | | -// 1. Save old directory that includes old volume's config json file. |
297 | | -// 2. Move virtual directory with content to where the local driver expects it to be. |
298 | | -// 3. Remove the backup of the old volume config. |
299 | | -func (daemon *Daemon) migrateVolume(id, vfs string) error { |
300 | | - volumeInfo := filepath.Join(daemon.root, defaultVolumesPathName, id) |
301 | | - backup := filepath.Join(daemon.root, defaultVolumesPathName, id+".back") |
302 | | - |
303 | | - var err error |
304 | | - if err = os.Rename(volumeInfo, backup); err != nil { |
305 | | - return err |
306 | | - } |
307 | | - defer func() { |
308 | | - // Put old configuration back in place in case one of the next steps fails. |
309 | | - if err != nil { |
310 | | - os.Rename(backup, volumeInfo) |
311 | | - } |
312 | | - }() |
313 | | - |
314 | | - if err = os.Rename(vfs, volumeInfo); err != nil { |
315 | | - return err |
316 | | - } |
317 | | - |
318 | | - if err = os.RemoveAll(backup); err != nil { |
319 | | - logrus.Errorf("Unable to remove volume info backup directory %s: %v", backup, err) |
320 | | - } |
321 | | - |
322 | | - return nil |
323 | | -} |
324 | | - |
325 | 293 | func createVolume(name, driverName string) (volume.Volume, error) { |
326 | 294 | vd, err := getVolumeDriver(driverName) |
327 | 295 | if err != nil { |
|
0 commit comments