Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the --cache-images flag. #3090

Merged
merged 2 commits into from
Aug 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 51 additions & 51 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions pkg/minikube/machine/cache_images.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@ package machine

import (
"io/ioutil"
"net/http"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
"strings"

"github.com/google/go-containerregistry/v1/tarball"
"github.com/google/go-containerregistry/pkg/v1/tarball"

"github.com/google/go-containerregistry/authn"
"github.com/google/go-containerregistry/pkg/authn"

"github.com/google/go-containerregistry/name"
"github.com/google/go-containerregistry/v1/remote"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"

"golang.org/x/sync/errgroup"

Expand Down Expand Up @@ -296,14 +295,16 @@ func CacheImage(image, dst string) error {
return errors.Wrap(err, "creating docker image name")
}

auth, err := authn.DefaultKeychain.Resolve(tag.Registry)
if err != nil {
return errors.Wrap(err, "setting up registry auth")
}
img, err := remote.Image(tag, auth, http.DefaultTransport)
img, err := remote.Image(tag, remote.WithAuthFromKeychain(authn.DefaultKeychain))
if err != nil {
return errors.Wrap(err, "fetching remote image")
}

return tarball.Write(dstPath, tag, img, nil)
glog.Infoln("OPENING: ", dstPath)
f, err := os.Create(dstPath)
if err != nil {
return err
}
defer f.Close()
return tarball.Write(tag, img, nil, f)
}
3 changes: 2 additions & 1 deletion test/integration/persistence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package integration

import (
"path/filepath"
"strings"
"testing"
"time"

Expand All @@ -28,10 +29,10 @@ import (
)

func TestPersistence(t *testing.T) {
minikubeRunner := NewMinikubeRunner(t)
if strings.Contains(minikubeRunner.StartArgs, "--vm-driver=none") {
t.Skip("skipping test as none driver does not support persistence")
}
minikubeRunner := NewMinikubeRunner(t)
minikubeRunner.EnsureRunning()

kubectlRunner := util.NewKubectlRunner(t)
Expand Down

This file was deleted.

This file was deleted.

Loading