Skip to content

Commit 78cc7ad

Browse files
authored
Merge pull request #802 from rabbitmq/kubectl-rabbitmq-linux
Adapt `kubectl rabbitmq manage INSTANCE` to support Linux
2 parents aecf155 + 9f29b8d commit 78cc7ad

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bin/kubectl-rabbitmq

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
set -euo pipefail
1212

13+
PLATFORM="$(uname)"
1314
NAMESPACE=""
1415

1516
instance=""
@@ -164,9 +165,16 @@ manage() {
164165
MGMT_PORT=15672
165166
MGMT_URL="http://localhost:$MGMT_PORT/"
166167
fi
168+
169+
if [[ "${PLATFORM}" == "Darwin" ]]; then
170+
OPEN="open"
171+
else
172+
OPEN="xdg-open"
173+
fi
174+
167175
(
168176
sleep 2
169-
open "$MGMT_URL"
177+
$OPEN "$MGMT_URL"
170178
) &
171179
kubectl ${NAMESPACE} port-forward "service/${service}" $MGMT_PORT
172180
}

0 commit comments

Comments
 (0)