fix(juju): add `public-address` fallback to `jaddr` (#12046)

pull/12055/head
Babak K. Shandiz 2023-11-20 14:52:32 +02:00 committed by GitHub
parent e0213342d1
commit 22f9a8d3b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -98,7 +98,7 @@ jaddr() {
elif [[ $# -eq 2 ]]; then
# Get unit address
juju status "$1/$2" --format=json \
| jq -r ".applications.\"$1\".units.\"$1/$2\".address"
| jq -r ".applications.\"$1\".units.\"$1/$2\" | .address // .\"public-address\""
else
echo "Invalid number of arguments."
echo "Usage: jaddr <app-name> [<unit-number>]"