summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/delete.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/delete.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/delete.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/projectatomic/buildah/delete.go b/vendor/github.com/projectatomic/buildah/delete.go
new file mode 100644
index 000000000..8de774ff9
--- /dev/null
+++ b/vendor/github.com/projectatomic/buildah/delete.go
@@ -0,0 +1,18 @@
+package buildah
+
+import (
+ "github.com/opencontainers/selinux/go-selinux/label"
+ "github.com/pkg/errors"
+)
+
+// Delete removes the working container. The buildah.Builder object should not
+// be used after this method is called.
+func (b *Builder) Delete() error {
+ if err := b.store.DeleteContainer(b.ContainerID); err != nil {
+ return errors.Wrapf(err, "error deleting build container")
+ }
+ b.MountPoint = ""
+ b.Container = ""
+ b.ContainerID = ""
+ return label.ReleaseLabel(b.ProcessLabel)
+}