Skip to content

Commit

Permalink
fallback to /dev/mapper device if metadata device is not set in docke…
Browse files Browse the repository at this point in the history
…r info
  • Loading branch information
sjenning committed Jun 21, 2016
1 parent 1c8d789 commit 8f3d376
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions utils/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,15 @@ func DockerThinPoolName(info dockertypes.Info) (string, error) {

func DockerMetadataDevice(info dockertypes.Info) (string, error) {
metadataDevice := DriverStatusValue(info.DriverStatus, DriverStatusMetadataFile)
if len(metadataDevice) == 0 {
return "", fmt.Errorf("Could not get the devicemapper metadata device")
if len(metadataDevice) != 0 {
return metadataDevice, nil
}

poolName := DockerThinPoolName(info)
if err != nil {
return "", err
}

metadataDevice = fmt.Sprintf("/dev/mapper/%s_tmeta", poolName)
return metadataDevice, nil
}

0 comments on commit 8f3d376

Please # to comment.