Introduce containerd-shim-runhcs-v1 on Windows
Implements the containerd-shim-runhcs-v1 shim on Windows for the runtime v2 shim API. Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
25
vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go
generated
vendored
Normal file
25
vendor/github.com/Microsoft/hcsshim/internal/wclayer/layerexists.go
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package wclayer
|
||||
|
||||
import (
|
||||
"github.com/Microsoft/hcsshim/internal/hcserror"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// LayerExists will return true if a layer with the given id exists and is known
|
||||
// to the system.
|
||||
func LayerExists(path string) (bool, error) {
|
||||
title := "hcsshim::LayerExists "
|
||||
logrus.Debugf(title+"path %s", path)
|
||||
|
||||
// Call the procedure itself.
|
||||
var exists uint32
|
||||
err := layerExists(&stdDriverInfo, path, &exists)
|
||||
if err != nil {
|
||||
err = hcserror.Errorf(err, title, "path=%s", path)
|
||||
logrus.Error(err)
|
||||
return false, err
|
||||
}
|
||||
|
||||
logrus.Debugf(title+"succeeded path=%s exists=%d", path, exists)
|
||||
return exists != 0, nil
|
||||
}
|
||||
Reference in New Issue
Block a user