Skip to content

Commit

Permalink
Save gvisor-image.tar in /files
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Jul 11, 2019
1 parent 1ec4012 commit 500cdf4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion hack/jenkins/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fi

# Build the gvisor image and store it as a tarball. This will be copied into minikube and loaded by ctr.
docker build -t gcr.io/k8s-minikube/gvisor-addon:latest -f testdata/gvisor-addon-Dockerfile out
docker save gcr.io/k8s-minikube/gvisor-addon:latest > out/gvisor-image.tar
docker save gcr.io/k8s-minikube/gvisor-addon:latest > ${MINIKUBE_HOME}/gvisor-image.tar

# Cleanup stale test outputs.
echo ""
Expand Down
15 changes: 2 additions & 13 deletions test/integration/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package integration

import (
"fmt"
"os/exec"
"strings"
"testing"

Expand Down Expand Up @@ -73,18 +72,8 @@ func TestFunctionalContainerd(t *testing.T) {
}

func loadGvisorImage(t *testing.T, m util.MinikubeRunner) {
localGvisorTarPath := "out/gvisor-image.tar"
minikubeGvisorTarPath := "/tmp/gvisor-image.tar"
// First, copy this tar into minikube.
cmd := exec.Command("sh", "-c", fmt.Sprintf("scp -i $(minikube ssh-key) %s docker@$(minikube ip):%s", localGvisorTarPath, minikubeGvisorTarPath))
output, err := cmd.CombinedOutput()
if err != nil {
pwd := exec.Command("pwd")
o, _ := pwd.CombinedOutput()
t.Logf("pwd: %s", string(o))
t.Fatalf("error building gvisor addon image: %v \n %s", err, string(output))
}
// Then, load the tar into the containerd daemon.
minikubeGvisorTarPath := "/gvisor-image.tar"
// Load the gvisor tar into the containerd daemon.
out, err := m.SSH(fmt.Sprintf("sudo ctr cri load %s", minikubeGvisorTarPath))
if err != nil {
t.Fatalf("error loading gvisor addon image: %v \n %s", err, out)
Expand Down

0 comments on commit 500cdf4

Please sign in to comment.