1package hcsshim 2 3import "github.com/sirupsen/logrus" 4 5// CreateLayer creates a new, empty, read-only layer on the filesystem based on 6// the parent layer provided. 7func CreateLayer(info DriverInfo, id, parent string) error { 8 title := "hcsshim::CreateLayer " 9 logrus.Debugf(title+"Flavour %d ID %s parent %s", info.Flavour, id, parent) 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 = createLayer(&infop, id, parent) 19 if err != nil { 20 err = makeErrorf(err, title, "id=%s parent=%s flavour=%d", id, parent, info.Flavour) 21 logrus.Error(err) 22 return err 23 } 24 25 logrus.Debugf(title+" - succeeded id=%s parent=%s flavour=%d", id, parent, info.Flavour) 26 return nil 27} 28