Skip to content

Commit c72f161

Browse files
committed
change the way finding the just built compose binary
Signed-off-by: Guillaume Lours <[email protected]>
1 parent 86a648b commit c72f161

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pkg/e2e/framework.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ func initializePlugins(t testing.TB, configDir string) {
134134
require.NoError(t, os.MkdirAll(filepath.Join(configDir, "cli-plugins"), 0o755),
135135
"Failed to create cli-plugins directory")
136136
composePlugin, err := findExecutable(DockerComposeExecutableName)
137-
if os.IsNotExist(err) {
138-
t.Logf("WARNING: docker-compose cli-plugin not found")
137+
if err != nil {
138+
t.Errorf("WARNING: docker-compose cli-plugin not found %s", err.Error())
139139
}
140140
buildxPlugin, err := findPluginExecutable(DockerBuildxExecutableName)
141141
if os.IsNotExist(err) {
@@ -159,8 +159,11 @@ func dirContents(dir string) []string {
159159
}
160160

161161
func findExecutable(executableName string) (string, error) {
162-
_, filename, _, _ := runtime.Caller(0)
163-
root := filepath.Join(filepath.Dir(filename), "..", "..")
162+
filename, err := os.Getwd()
163+
if err != nil {
164+
return "", err
165+
}
166+
root := filepath.Join(filepath.Dir(filename), "..")
164167
buildPath := filepath.Join(root, "bin", "build")
165168

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

0 commit comments

Comments
 (0)