mirror of
https://github.com/mudler/luet.git
synced 2025-09-07 02:00:39 +00:00
Use API also when pulling from helpers used in client
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
package backend
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
@@ -178,33 +177,6 @@ func (s *SimpleImg) ExportImage(opts Options) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ExtractRootfs extracts the docker image content inside the destination
|
||||
func (s *SimpleImg) ExtractRootfs(opts Options, keepPerms bool) error {
|
||||
name := opts.ImageName
|
||||
path := opts.Destination
|
||||
|
||||
if !s.ImageExists(name) {
|
||||
if err := s.DownloadImage(opts); err != nil {
|
||||
return errors.Wrap(err, "failed pulling image "+name+" during extraction")
|
||||
}
|
||||
}
|
||||
|
||||
os.RemoveAll(path)
|
||||
|
||||
buildarg := []string{"unpack", "-o", path, name}
|
||||
s.ctx.Debug(":tea: Extracting image " + name)
|
||||
|
||||
s.ctx.Spinner()
|
||||
defer s.ctx.SpinnerStop()
|
||||
|
||||
out, err := exec.Command("img", buildarg...).CombinedOutput()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "Failed extracting image: "+string(out))
|
||||
}
|
||||
s.ctx.Debug(":tea: Image " + name + " extracted")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *SimpleImg) Push(opts Options) error {
|
||||
name := opts.ImageName
|
||||
bus.Manager.Publish(bus.EventImagePrePush, opts)
|
||||
|
Reference in New Issue
Block a user