driverData gets the driver data from the store on a layer
()
| 853 | |
| 854 | // driverData gets the driver data from the store on a layer |
| 855 | func (i *Image) driverData() (*DriverData, error) { |
| 856 | store := i.runtime.store |
| 857 | layerID := i.TopLayer() |
| 858 | driver, err := store.GraphDriver() |
| 859 | if err != nil { |
| 860 | return nil, err |
| 861 | } |
| 862 | metaData, err := driver.Metadata(layerID) |
| 863 | if err != nil { |
| 864 | return nil, err |
| 865 | } |
| 866 | if mountTimes, err := store.Mounted(layerID); mountTimes == 0 || err != nil { |
| 867 | delete(metaData, "MergedDir") |
| 868 | } |
| 869 | return &DriverData{ |
| 870 | Name: driver.String(), |
| 871 | Data: metaData, |
| 872 | }, nil |
| 873 | } |
| 874 | |
| 875 | // StorageReference returns the image's reference to the containers storage |
| 876 | // using the image ID. |