unpreparelayer.go 688 B

12345678910111213141516171819202122232425262728293031
  1. package wclayer
  2. import (
  3. "github.com/Microsoft/hcsshim/internal/hcserror"
  4. "github.com/sirupsen/logrus"
  5. )
  6. // UnprepareLayer disables the filesystem filter for the read-write layer with
  7. // the given id.
  8. func UnprepareLayer(path string) (err error) {
  9. title := "hcsshim::UnprepareLayer"
  10. fields := logrus.Fields{
  11. "path": path,
  12. }
  13. logrus.WithFields(fields).Debug(title)
  14. defer func() {
  15. if err != nil {
  16. fields[logrus.ErrorKey] = err
  17. logrus.WithFields(fields).Error(err)
  18. } else {
  19. logrus.WithFields(fields).Debug(title + " - succeeded")
  20. }
  21. }()
  22. err = unprepareLayer(&stdDriverInfo, path)
  23. if err != nil {
  24. return hcserror.New(err, title+" - failed", "")
  25. }
  26. return nil
  27. }