From 9c41bdcd16fcd5a4b9142cdcf797fa33635bebec Mon Sep 17 00:00:00 2001 From: Jorge Padilla Date: Fri, 14 Apr 2023 12:32:30 -0500 Subject: [PATCH] fix(cli): fix TRACETEST_DEV in docker compose installer (#2394) --- cli/analytics/analytics.go | 3 ++- cli/installer/docker_compose.go | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/analytics/analytics.go b/cli/analytics/analytics.go index 5106605d7f..dc4dfdb92b 100644 --- a/cli/analytics/analytics.go +++ b/cli/analytics/analytics.go @@ -1,10 +1,11 @@ package analytics import ( + "os" + "github.com/denisbrodbeck/machineid" "github.com/kubeshop/tracetest/cli/config" segment "github.com/segmentio/analytics-go/v3" - "os" ) var ( diff --git a/cli/installer/docker_compose.go b/cli/installer/docker_compose.go index fe5fd48698..6da0b5b1be 100644 --- a/cli/installer/docker_compose.go +++ b/cli/installer/docker_compose.go @@ -71,7 +71,7 @@ func dockerComposeInstaller(config configuration, ui cliUI.UI) { dockerComposeFName := filepath.Join(dir, dockerComposeFilename) dockerCmd := fmt.Sprintf( - "docker compose -f %s up -d", + "docker compose -f %s up -d", dockerComposeFName, ) @@ -130,6 +130,7 @@ func getDockerComposeFileContents(ui cliUI.UI, config configuration) []byte { sout := fixPortConfig(string(output)) sout = strings.ReplaceAll(sout, "$", "$$") + sout = strings.ReplaceAll(sout, "$${TRACETEST_DEV}", "${TRACETEST_DEV}") return []byte(sout) } @@ -259,6 +260,8 @@ func fixTracetestContainer(config configuration, project *types.Project, version tts.Image = "kubeshop/tracetest:" + version tts.Build = nil tts.Volumes[0].Source = tracetestConfigFilename + tracetestDevEnv := "${TRACETEST_DEV}" + tts.Environment["TRACETEST_DEV"] = &tracetestDevEnv replaceService(project, serviceName, tts)