Point docker daemon to minikube and rebuild docker image
parent
e6653b78eb
commit
3ffe2af1e4
|
@ -70,3 +70,4 @@ spec:
|
|||
hostPath:
|
||||
path: /tmp/gvisor
|
||||
restartPolicy: Always
|
||||
imagePullPolicy: IfNotPresent
|
||||
|
|
|
@ -89,12 +89,6 @@ if [[ "${procs}" != "" ]]; then
|
|||
kill -9 ${procs} || true
|
||||
fi
|
||||
|
||||
# Build and push gvisor image
|
||||
echo ">> Building gvisor addon image locally."
|
||||
export GVISOR_ADDON_REPO="gcr.io/k8s-minikube/integration/${MINIKUBE_LOCATION}"
|
||||
docker build -t ${GVISOR_ADDON_REPO}/gvisor-addon:latest -f testdata/gvisor-addon-Dockerfile out
|
||||
docker push ${GVISOR_ADDON_REPO}/gvisor-addon:latest
|
||||
|
||||
# Cleanup stale test outputs.
|
||||
echo ""
|
||||
echo ">> Cleaning up after previous test runs ..."
|
||||
|
|
|
@ -19,6 +19,7 @@ limitations under the License.
|
|||
package integration
|
||||
|
||||
import (
|
||||
"os/exec"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
|
@ -61,11 +62,23 @@ func TestFunctionalContainerd(t *testing.T) {
|
|||
}
|
||||
|
||||
r.Start("--container-runtime=containerd", "--docker-opt containerd=/var/run/containerd/containerd.sock")
|
||||
|
||||
// Build the gvisor image in Minikube
|
||||
buildGvisorImage(t)
|
||||
|
||||
t.Run("Gvisor", testGvisor)
|
||||
t.Run("GvisorRestart", testGvisorRestart)
|
||||
r.RunCommand("delete", true)
|
||||
}
|
||||
|
||||
func buildGvisorImage(t *testing.T) {
|
||||
cmd := exec.Command("sh", "-c", "eval $(minikube docker-env) && docker build -t gcr.io/k8s-minikube/gvisor-addon:latest -f testdata/gvisor-addon-Dockerfile out")
|
||||
output, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("error building gvisor addon image: %v \n %s", err, string(output))
|
||||
}
|
||||
}
|
||||
|
||||
// usingNoneDriver returns true if using the none driver
|
||||
func usingNoneDriver(r util.MinikubeRunner) bool {
|
||||
return strings.Contains(r.StartArgs, "--vm-driver=none")
|
||||
|
|
Loading…
Reference in New Issue