Files
docker-cli/components/engine/layer/layer_windows.go
John Howard 9768c5da08 Windows: Remove redundant 'GraphDriver() func
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2cd8bcd7df1b1a204fe20118afe9556fe5a0b7ba
Component: engine
2017-01-12 15:32:46 -08:00

35 lines
654 B
Go

package layer
import "errors"
// GetLayerPath returns the path to a layer
func GetLayerPath(s Store, layer ChainID) (string, error) {
ls, ok := s.(*layerStore)
if !ok {
return "", errors.New("unsupported layer store")
}
ls.layerL.Lock()
defer ls.layerL.Unlock()
rl, ok := ls.layerMap[layer]
if !ok {
return "", ErrLayerDoesNotExist
}
path, err := ls.driver.Get(rl.cacheID, "")
if err != nil {
return "", err
}
if err := ls.driver.Put(rl.cacheID); err != nil {
return "", err
}
return path, nil
}
func (ls *layerStore) mountID(name string) string {
// windows has issues if container ID doesn't match mount ID
return name
}