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