Skip to content

Commit b2cdc3b

Browse files
committed
feat(integration): copy bpftrace image inside the kind docker daemon
Signed-off-by: Lorenzo Fontana <[email protected]>
1 parent 9cbfd9c commit b2cdc3b

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

integration/suite_test.go

+16-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"time"
1010

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

4748
clusterName, err := generateClusterName()
4849
c.Assert(err, check.IsNil)
49-
ctx := cluster.NewContext(clusterName)
50-
err = ctx.Create(cfg, retain, wait)
50+
kctx := cluster.NewContext(clusterName)
51+
52+
err = kctx.Create(cfg, retain, wait)
53+
c.Assert(err, check.IsNil)
54+
k.kindContext = kctx
55+
56+
nodes, err := kctx.ListNodes()
57+
5158
c.Assert(err, check.IsNil)
52-
k.kindContext = ctx
59+
60+
// copy the bpftrace image to the nodes
61+
for _, n := range nodes {
62+
loadcomm := fmt.Sprintf("docker save %s | docker exec -i %s docker load", version.ImageNameTag(), n.String())
63+
res := icmd.RunCommand("bash", "-c", loadcomm)
64+
c.Assert(res.Error, check.IsNil)
65+
}
5366
}
5467

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

0 commit comments

Comments
 (0)