Skip to content

Commit

Permalink
fix(integration): public (default) image name tag
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Di Donato <[email protected]>
  • Loading branch information
leodido authored and fntlnz committed Feb 7, 2019
1 parent 6c4c743 commit 70b0268
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ IMAGE_BPFTRACE_BASE := $(IMAGE_NAME_BASE):$(BPFTRACESHA)

IMAGE_BUILD_FLAGS ?= "--no-cache"

LDFLAGS := -ldflags '-X github.com/iovisor/kubectl-trace/pkg/version.buildTime=$(shell date +%s) -X github.com/iovisor/kubectl-trace/pkg/version.gitCommit=${GIT_COMMIT} -X github.com/iovisor/kubectl-trace/pkg/cmd.imageNameTag=${IMAGE_TRACERUNNER_COMMIT} -X github.com/iovisor/kubectl-trace/pkg/cmd.initImageNameTag=${IMAGE_INITCONTAINER_COMMIT}'
LDFLAGS := -ldflags '-X github.com/iovisor/kubectl-trace/pkg/version.buildTime=$(shell date +%s) -X github.com/iovisor/kubectl-trace/pkg/version.gitCommit=${GIT_COMMIT} -X github.com/iovisor/kubectl-trace/pkg/cmd.ImageNameTag=${IMAGE_TRACERUNNER_COMMIT} -X github.com/iovisor/kubectl-trace/pkg/cmd.InitImageNameTag=${IMAGE_INITCONTAINER_COMMIT}'
TESTPACKAGES := $(shell go list ./... | grep -v github.com/iovisor/kubectl-trace/integration)

kubectl_trace ?= _output/bin/kubectl-trace
Expand Down Expand Up @@ -71,7 +71,7 @@ test:

.PHONY: integration
integration:
TEST_KUBECTLTRACE_BINARY=$(shell pwd)/$(kubectl_trace) $(GO) test ${LDFLAGS} -v ./integration/...
TEST_KUBECTLTRACE_BINARY=$(shell pwd)/$(kubectl_trace) $(GO) test ${LDFLAGS} -v ./integration/...

.PHONY: bpftraceimage/build
bpftraceimage/build:
Expand Down
4 changes: 2 additions & 2 deletions integration/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

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

// 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())
loadcomm := fmt.Sprintf("docker save %s | docker exec -i %s docker load", cmd.ImageNameTag, n.String())
res := icmd.RunCommand("bash", "-c", loadcomm)
c.Assert(res.Error, check.IsNil)
}
Expand Down
10 changes: 6 additions & 4 deletions pkg/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import (
)

const (
imageNameTag = "quay.io/fntlnz/kubectl-trace-bpftrace:latest"
initImageNameTag = "quay.io/dalehamel/kubectl-trace-init"
// ImageNameTag represents the default tracerunner image
ImageNameTag = "quay.io/fntlnz/kubectl-trace-bpftrace:latest"
// InitImageNameTag represents the default init container image
InitImageNameTag = "quay.io/dalehamel/kubectl-trace-init:latest"
)

var (
Expand Down Expand Up @@ -85,8 +87,8 @@ func NewRunOptions(streams genericclioptions.IOStreams) *RunOptions {
IOStreams: streams,

serviceAccount: "default",
imageName: imageNameTag,
initImageName: initImageNameTag,
imageName: ImageNameTag,
initImageName: InitImageNameTag,
}
}

Expand Down

0 comments on commit 70b0268

Please sign in to comment.