WIP
parent
c629b9b81c
commit
99d75c6b5b
|
@ -34,7 +34,6 @@ import (
|
|||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||
"github.com/google/go-containerregistry/pkg/v1/daemon"
|
||||
"github.com/google/go-containerregistry/pkg/v1/remote"
|
||||
"github.com/google/go-containerregistry/pkg/v1/tarball"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/minikube/pkg/minikube/constants"
|
||||
"k8s.io/minikube/pkg/minikube/localpath"
|
||||
|
@ -101,15 +100,9 @@ func LoadFromTarball(img string) error {
|
|||
p := filepath.Join(constants.ImageCacheDir, img)
|
||||
p = localpath.SanitizeCacheDir(p)
|
||||
|
||||
tag, err := name.NewTag(img)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "tag")
|
||||
}
|
||||
|
||||
i, err := tarball.ImageFromPath(p, &tag)
|
||||
_, err = daemon.Write(tag, i)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "writing daemon image")
|
||||
cmd := exec.Command("docker", "load", "-i", p)
|
||||
if output, err := cmd.CombinedOutput(); err != nil {
|
||||
return errors.Wrapf(err, "%s", string(output))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -130,6 +130,8 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down
|
|||
glog.Infof("successfully loaded %s from cached tarball", img)
|
||||
finalImg = img
|
||||
return nil
|
||||
} else {
|
||||
fmt.Println("Failed to load tarball:", err)
|
||||
}
|
||||
glog.Infof("Downloading %s to local daemon", img)
|
||||
err := image.WriteImageToDaemon(img)
|
||||
|
|
Loading…
Reference in New Issue