unpreparelayer.go 693 B

123456789101112131415161718192021222324252627
  1. //go:build windows
  2. package wclayer
  3. import (
  4. "context"
  5. "github.com/Microsoft/hcsshim/internal/hcserror"
  6. "github.com/Microsoft/hcsshim/internal/oc"
  7. "go.opencensus.io/trace"
  8. )
  9. // UnprepareLayer disables the filesystem filter for the read-write layer with
  10. // the given id.
  11. func UnprepareLayer(ctx context.Context, path string) (err error) {
  12. title := "hcsshim::UnprepareLayer"
  13. ctx, span := oc.StartSpan(ctx, title) //nolint:ineffassign,staticcheck
  14. defer span.End()
  15. defer func() { oc.SetSpanStatus(span, err) }()
  16. span.AddAttributes(trace.StringAttribute("path", path))
  17. err = unprepareLayer(&stdDriverInfo, path)
  18. if err != nil {
  19. return hcserror.New(err, title, "")
  20. }
  21. return nil
  22. }