mirror of https://github.com/k3s-io/k3s
Merge pull request #10027 from caesarxuchao/rethinkdb-example-v1
remove references to v1beta3 in rethinkdb examplepull/6/head
commit
458cbd3b5d
|
@ -22,7 +22,7 @@ if [[ -n "${KUBERNETES_RO_SERVICE_HOST}" ]]; then
|
||||||
: ${NAMESPACE:=rethinkdb}
|
: ${NAMESPACE:=rethinkdb}
|
||||||
# try to pick up first different ip from endpoints
|
# try to pick up first different ip from endpoints
|
||||||
MYHOST=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
MYHOST=$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')
|
||||||
URL="${KUBERNETES_RO_SERVICE_HOST}/api/v1beta3/namespaces/${NAMESPACE}/endpoints/rethinkdb-driver"
|
URL="${KUBERNETES_RO_SERVICE_HOST}/api/v1/namespaces/${NAMESPACE}/endpoints/rethinkdb-driver"
|
||||||
IP=$(curl -s ${URL} | jq -s -r --arg h "${MYHOST}" '.[0].subsets | .[].addresses | [ .[].IP ] | map(select(. != $h)) | .[0]') || exit 1
|
IP=$(curl -s ${URL} | jq -s -r --arg h "${MYHOST}" '.[0].subsets | .[].addresses | [ .[].IP ] | map(select(. != $h)) | .[0]') || exit 1
|
||||||
[[ "${IP}" == null ]] && IP=""
|
[[ "${IP}" == null ]] && IP=""
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue