Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 89a1a27

Browse files
authored
Merge pull request #1723 from docker/master_fail
ignore missing docker-compose cli-plugin, not required for ECS/ACI/Ku…
2 parents 41d5cfd + 8e8122f commit 89a1a27

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

utils/e2e/framework.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package e2e
1818

1919
import (
20-
"errors"
2120
"fmt"
2221
"io"
2322
"io/ioutil"
@@ -31,6 +30,7 @@ import (
3130
"testing"
3231
"time"
3332

33+
"github.com/pkg/errors"
3434
"gotest.tools/v3/assert"
3535
is "gotest.tools/v3/assert/cmp"
3636
"gotest.tools/v3/icmd"
@@ -90,10 +90,15 @@ func newE2eCLI(t *testing.T, binDir string) *E2eCLI {
9090
if runtime.GOOS == "windows" {
9191
composePluginFile += ".exe"
9292
}
93-
composePlugin, _ := findExecutable(composePluginFile, []string{"../../bin", "../../../bin"})
94-
err = CopyFile(composePlugin, filepath.Join(d, "cli-plugins", composePluginFile))
95-
if err != nil {
96-
panic(err)
93+
composePlugin, err := findExecutable(composePluginFile, []string{"../../bin", "../../../bin"})
94+
if os.IsNotExist(err) {
95+
fmt.Println("WARNING: docker-compose cli-plugin not found")
96+
}
97+
if err == nil {
98+
err = CopyFile(composePlugin, filepath.Join(d, "cli-plugins", composePluginFile))
99+
if err != nil {
100+
panic(err)
101+
}
97102
}
98103

99104
return &E2eCLI{binDir, d, t}
@@ -158,7 +163,7 @@ func findExecutable(executableName string, paths []string) (string, error) {
158163
return bin, nil
159164
}
160165

161-
return "", errors.New("executable not found")
166+
return "", errors.Wrap(os.ErrNotExist, "executable not found")
162167
}
163168

164169
// CopyFile copies a file from a sourceFile to a destinationFile setting permissions to 0755

0 commit comments

Comments
 (0)