...

Source file src/github.com/Microsoft/hcsshim/internal/wclayer/destroylayer.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  // DestroyLayer will remove the on-disk files representing the layer with the given
    14  // path, including that layer's containing folder, if any.
    15  func DestroyLayer(ctx context.Context, path string) (err error) {
    16  	title := "hcsshim::DestroyLayer"
    17  	ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
    18  	defer span.End()
    19  	defer func() { oc.SetSpanStatus(span, err) }()
    20  	span.AddAttributes(trace.StringAttribute("path", path))
    21  
    22  	err = destroyLayer(&stdDriverInfo, path)
    23  	if err != nil {
    24  		return hcserror.New(err, title, "")
    25  	}
    26  	return nil
    27  }
    28  

View as plain text