destroylayer.go 718 B

123456789101112131415161718192021222324252627
  1. package hcsshim
  2. import "github.com/Sirupsen/logrus"
  3. // DestroyLayer will remove the on-disk files representing the layer with the given
  4. // id, including that layer's containing folder, if any.
  5. func DestroyLayer(info DriverInfo, id string) error {
  6. title := "hcsshim::DestroyLayer "
  7. logrus.Debugf(title+"Flavour %d ID %s", info.Flavour, id)
  8. // Convert info to API calling convention
  9. infop, err := convertDriverInfo(info)
  10. if err != nil {
  11. logrus.Error(err)
  12. return err
  13. }
  14. err = destroyLayer(&infop, id)
  15. if err != nil {
  16. err = makeErrorf(err, title, "id=%s flavour=%d", id, info.Flavour)
  17. logrus.Error(err)
  18. return err
  19. }
  20. logrus.Debugf(title+"succeeded flavour=%d id=%s", info.Flavour, id)
  21. return nil
  22. }