createlayer.go 645 B

1234567891011121314151617181920212223
  1. package wclayer
  2. import (
  3. "github.com/Microsoft/hcsshim/internal/hcserror"
  4. "github.com/sirupsen/logrus"
  5. )
  6. // CreateLayer creates a new, empty, read-only layer on the filesystem based on
  7. // the parent layer provided.
  8. func CreateLayer(path, parent string) error {
  9. title := "hcsshim::CreateLayer "
  10. logrus.Debugf(title+"Flavour %d ID %s parent %s", path, parent)
  11. err := createLayer(&stdDriverInfo, path, parent)
  12. if err != nil {
  13. err = hcserror.Errorf(err, title, "path=%s parent=%s flavour=%d", path, parent)
  14. logrus.Error(err)
  15. return err
  16. }
  17. logrus.Debugf(title+" - succeeded path=%s parent=%s flavour=%d", path, parent)
  18. return nil
  19. }