mirror of
https://github.com/containers/skopeo.git
synced 2026-07-15 06:55:09 +00:00
Pull most of the core logic from the CLI into a package that should be easier to consume as a library. Add a "config" command that updates the builder object's configuration. Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
24 lines
440 B
Go
24 lines
440 B
Go
package buildah
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
func (b *Builder) Delete() error {
|
|
for _, link := range b.Links {
|
|
if err := os.Remove(link); err != nil {
|
|
return fmt.Errorf("error removing symlink %q: %v", link, err)
|
|
}
|
|
}
|
|
b.Links = nil
|
|
|
|
if err := b.store.DeleteContainer(b.ContainerID); err != nil {
|
|
return fmt.Errorf("error deleting build container: %v", err)
|
|
}
|
|
b.MountPoint = ""
|
|
b.Container = ""
|
|
b.ContainerID = ""
|
|
return nil
|
|
}
|