...

Source file src/github.com/Microsoft/hcsshim/internal/wclayer/createlayer.go

Documentation: github.com/Microsoft/hcsshim/internal/wclayer

     1  //go:build windows
     2  
     3  package wclayer
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/Microsoft/hcsshim/internal/hcserror"
     9  	"github.com/Microsoft/hcsshim/internal/oc"
    10  	"go.opencensus.io/trace"
    11  )
    12  
    13  // CreateLayer creates a new, empty, read-only layer on the filesystem based on
    14  // the parent layer provided.
    15  func CreateLayer(ctx context.Context, path, parent string) (err error) {
    16  	title := "hcsshim::CreateLayer"
    17  	ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
    18  	defer span.End()
    19  	defer func() { oc.SetSpanStatus(span, err) }()
    20  	span.AddAttributes(
    21  		trace.StringAttribute("path", path),
    22  		trace.StringAttribute("parent", parent))
    23  
    24  	err = createLayer(&stdDriverInfo, path, parent)
    25  	if err != nil {
    26  		return hcserror.New(err, title, "")
    27  	}
    28  	return nil
    29  }
    30  

View as plain text