Skip to content

Commit

Permalink
change the way finding the just built compose binary
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Lours <705411+glours@users.noreply.github.com>
  • Loading branch information
glours committed Dec 21, 2022
1 parent 86a648b commit 183a092
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/e2e/framework.go
Expand Up @@ -138,8 +138,8 @@ func initializePlugins(t testing.TB, configDir string) {
t.Logf("WARNING: docker-compose cli-plugin not found")
}
buildxPlugin, err := findPluginExecutable(DockerBuildxExecutableName)
if os.IsNotExist(err) {
t.Logf("WARNING: docker-buildx cli-plugin not found")
if err != nil {
t.Errorf("WARNING: docker-buildx cli-plugin not found ", err)
}
if err == nil {
CopyFile(t, composePlugin, filepath.Join(configDir, "cli-plugins", DockerComposeExecutableName))
Expand All @@ -159,8 +159,11 @@ func dirContents(dir string) []string {
}

func findExecutable(executableName string) (string, error) {
_, filename, _, _ := runtime.Caller(0)
root := filepath.Join(filepath.Dir(filename), "..", "..")
filename, err := os.Getwd()
if err != nil {
return "", err
}
root := filepath.Join(filepath.Dir(filename), "..")
buildPath := filepath.Join(root, "bin", "build")

bin, err := filepath.Abs(filepath.Join(buildPath, executableName))
Expand Down

0 comments on commit 183a092

Please sign in to comment.