...

Source file src/github.com/Microsoft/hcsshim/computestorage/detach.go

Documentation: github.com/Microsoft/hcsshim/computestorage

     1  //go:build windows
     2  
     3  package computestorage
     4  
     5  import (
     6  	"context"
     7  
     8  	"github.com/Microsoft/hcsshim/internal/oc"
     9  	"github.com/pkg/errors"
    10  	"go.opencensus.io/trace"
    11  )
    12  
    13  // DetachLayerStorageFilter detaches the layer storage filter on a writable container layer.
    14  //
    15  // `layerPath` is a path to a directory containing the layer to export.
    16  func DetachLayerStorageFilter(ctx context.Context, layerPath string) (err error) {
    17  	title := "hcsshim::DetachLayerStorageFilter"
    18  	ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
    19  	defer span.End()
    20  	defer func() { oc.SetSpanStatus(span, err) }()
    21  	span.AddAttributes(trace.StringAttribute("layerPath", layerPath))
    22  
    23  	err = hcsDetachLayerStorageFilter(layerPath)
    24  	if err != nil {
    25  		return errors.Wrap(err, "failed to detach layer storage filter")
    26  	}
    27  	return nil
    28  }
    29  

View as plain text