zaunist commented on code in PR #1213:
URL:
https://github.com/apache/apisix-ingress-controller/pull/1213#discussion_r939470991
##########
test/e2e/testdata/wolf-rbac/cmd.sh:
##########
@@ -20,20 +20,26 @@
cd test/e2e/testdata/wolf-rbac/
OPTION=$1
+COMPOSE="docker-compose"
+
+if ! command -v "docker-compose" > /dev/null; then
+ echo "docker-compose not found, try docker compose"
+ COMPOSE="docker compose"
+fi
if [ $OPTION = "ip" ]; then
echo -n `docker inspect -f '{{range
.NetworkSettings.Networks}}{{.Gateway}}{{end}}' wolf-server`
elif [ $OPTION = "start" ]; then
- docker-compose -f 'docker-compose.yaml' -p 'wolf-rbac' down
+ eval "$COMPOSE -f 'docker-compose.yaml' -p 'wolf-rbac' down"
Review Comment:
Due to the `compose` is a subcommand of `docker`, a form like this would be
wrong,
```
cmd='docker compose'
$cmd xxx
```
e.g.
```
~
⍉
▶ cm='docker compose'
~
▶ $cm version
zsh: command not found: docker compose
~
⍉
▶ eval $cm version
Docker Compose version v2.7.0
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]