🔧 Extract common func into api function, also set sane defaults

This commit is contained in:
Ettore Di Giacinto
2021-12-28 18:55:59 +01:00
parent 719ef16161
commit 196cdc5cfc
8 changed files with 171 additions and 27 deletions

View File

@@ -18,7 +18,6 @@ package backend
import (
"os/exec"
"github.com/google/go-containerregistry/pkg/crane"
"github.com/mudler/luet/pkg/api/core/types"
"github.com/pkg/errors"
)
@@ -28,13 +27,6 @@ const (
DockerBackend = "docker"
)
func imageAvailable(image string) bool {
// We use crane.insecure as we just check if the image is available
// It's the daemon duty to use it or not based on the host settings
_, err := crane.Digest(image, crane.Insecure)
return err == nil
}
type Options struct {
ImageName string
SourcePath string