mirror of
https://github.com/kemko/reproxy.git
synced 2026-01-10 12:15:45 +03:00
27 lines
647 B
Go
27 lines
647 B
Go
package computestorage
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/Microsoft/hcsshim/internal/oc"
|
|
"go.opencensus.io/trace"
|
|
)
|
|
|
|
// DestroyLayer deletes a container layer.
|
|
//
|
|
// `layerPath` is a path to a directory containing the layer to export.
|
|
func DestroyLayer(ctx context.Context, layerPath string) (err error) {
|
|
title := "hcsshim.DestroyLayer"
|
|
ctx, span := trace.StartSpan(ctx, title)
|
|
defer span.End()
|
|
defer func() { oc.SetSpanStatus(span, err) }()
|
|
span.AddAttributes(trace.StringAttribute("layerPath", layerPath))
|
|
|
|
err = hcsDestroyLayer(layerPath)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to destroy layer: %s", err)
|
|
}
|
|
return nil
|
|
}
|