summaryrefslogtreecommitdiff
path: root/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go')
-rw-r--r--vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go b/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go
new file mode 100644
index 000000000..ecf3b550d
--- /dev/null
+++ b/vendor/github.com/Microsoft/hcsshim/computestorage/destroy.go
@@ -0,0 +1,26 @@
+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
+}