packagewclayerimport("github.com/Microsoft/hcsshim/internal/hcserror""github.com/sirupsen/logrus")// CreateScratchLayer creates and populates new read-write layer for use by a container.// This requires both the id of the direct parent layer, as well as the full list// of paths to all parent layers up to the base (and including the direct parent// whose id was provided).funcCreateScratchLayer(pathstring,parentLayerPaths[]string)(errerror){title:="hcsshim::CreateScratchLayer"fields:=logrus.Fields{"path":path,}logrus.WithFields(fields).Debug(title)deferfunc(){iferr!=nil{fields[logrus.ErrorKey]=errlogrus.WithFields(fields).Error(err)}else{logrus.WithFields(fields).Debug(title+" - succeeded")}}()// Generate layer descriptorslayers,err:=layerPathsToDescriptors(parentLayerPaths)iferr!=nil{returnerr}err=createSandboxLayer(&stdDriverInfo,path,0,layers)iferr!=nil{returnhcserror.New(err,title+" - failed","")}returnnil}