Skip to content

Commit

Permalink
Merge pull request #802 from rabbitmq/kubectl-rabbitmq-linux
Browse files Browse the repository at this point in the history
Adapt `kubectl rabbitmq manage INSTANCE` to support Linux
  • Loading branch information
Zerpet authored Aug 16, 2021
2 parents aecf155 + 9f29b8d commit 78cc7ad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bin/kubectl-rabbitmq
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

set -euo pipefail

PLATFORM="$(uname)"
NAMESPACE=""

instance=""
Expand Down Expand Up @@ -164,9 +165,16 @@ manage() {
MGMT_PORT=15672
MGMT_URL="http://localhost:$MGMT_PORT/"
fi

if [[ "${PLATFORM}" == "Darwin" ]]; then
OPEN="open"
else
OPEN="xdg-open"
fi

(
sleep 2
open "$MGMT_URL"
$OPEN "$MGMT_URL"
) &
kubectl ${NAMESPACE} port-forward "service/${service}" $MGMT_PORT
}
Expand Down

0 comments on commit 78cc7ad

Please sign in to comment.