From 3d1ec52c7d1cb553734400bb7a7b28932550cf5a Mon Sep 17 00:00:00 2001 From: Chuck Ha Date: Wed, 24 Apr 2019 13:04:55 -0400 Subject: [PATCH] e2e testing improvement * Bump kind version * Remove docker load in favor of kind load for e2e cluster Signed-off-by: Chuck Ha --- WORKSPACE | 2 +- test/e2e/util/kind/setup.go | 24 +++++------------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index bb650fdebf..d591085e04 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -104,7 +104,7 @@ go_repository( go_repository( name = "io_k8s_sigs_kind", importpath = "sigs.k8s.io/kind", - tag = "0.1.0", + tag = "0.2.1", ) go_repository( diff --git a/test/e2e/util/kind/setup.go b/test/e2e/util/kind/setup.go index 17f0963c7d..12195403c0 100644 --- a/test/e2e/util/kind/setup.go +++ b/test/e2e/util/kind/setup.go @@ -51,8 +51,6 @@ var ( managerImageTar = flag.String("managerImageTar", "", "a script to load the manager Docker image into Docker") ) -const kindContainerName = "kind-1-control-plane" - // Cluster represents the running state of a KIND cluster. // An empty struct is enough to call Setup() on. type Cluster struct { @@ -73,28 +71,16 @@ func (c *Cluster) Setup() { fmt.Fprintf(ginkgo.GinkgoWriter, "export KUBECONFIG=%s\n", c.kubepath) if *managerImageTar != "" { - c.loadImage() + fmt.Fprintf( + ginkgo.GinkgoWriter, + "loading image %q into Kind node\n", + *managerImageTar) + c.run(exec.Command(*kindBinary, "load", "image-archive", *managerImageTar)) } c.applyYAML() } -func (c *Cluster) loadImage() { - // TODO(EKF): once kind supports loading images directly, remove this hack - fmt.Fprintf( - ginkgo.GinkgoWriter, - "loading image %q into nested docker instance\n", - *managerImageTar) - file, err := os.Open(*managerImageTar) - gomega.Expect(err).To(gomega.BeNil()) - - // Pipe the tar file into the kind container then docker-load it - cmd := exec.Command("docker", "exec", "--interactive", kindContainerName, "docker", "load") - cmd.Stdin = file - cmd.Stdout = ginkgo.GinkgoWriter - c.run(cmd) -} - // Teardown attempts to delete the KIND cluster func (c *Cluster) Teardown() { c.run(exec.Command(*kindBinary, "delete", "cluster"))