Skip to content

Commit

Permalink
feat(integration): copy bpftrace image inside the kind docker daemon
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Fontana <lo@linux.com>
  • Loading branch information
fntlnz committed Jan 9, 2019
1 parent 9cbfd9c commit b2cdc3b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"time"

"github.com/go-check/check"
"github.com/iovisor/kubectl-trace/pkg/version"
"gotest.tools/icmd"
"sigs.k8s.io/kind/pkg/cluster"
"sigs.k8s.io/kind/pkg/cluster/config/encoding"
Expand Down Expand Up @@ -46,10 +47,22 @@ func (k *KubectlTraceSuite) SetUpSuite(c *check.C) {

clusterName, err := generateClusterName()
c.Assert(err, check.IsNil)
ctx := cluster.NewContext(clusterName)
err = ctx.Create(cfg, retain, wait)
kctx := cluster.NewContext(clusterName)

err = kctx.Create(cfg, retain, wait)
c.Assert(err, check.IsNil)
k.kindContext = kctx

nodes, err := kctx.ListNodes()

c.Assert(err, check.IsNil)
k.kindContext = ctx

// copy the bpftrace image to the nodes
for _, n := range nodes {
loadcomm := fmt.Sprintf("docker save %s | docker exec -i %s docker load", version.ImageNameTag(), n.String())
res := icmd.RunCommand("bash", "-c", loadcomm)
c.Assert(res.Error, check.IsNil)
}
}

func (s *KubectlTraceSuite) TearDownSuite(c *check.C) {
Expand Down

0 comments on commit b2cdc3b

Please sign in to comment.