Reuse get_app_pods() in get_app_pod()
@@ -185,9 +185,8 @@ function wait_until_routable() {
# Parameters: $1 - app name.
# $2 - namespace (optional).
function get_app_pod() {
- local namespace=""
- [[ -n $2 ]] && namespace="-n $2"
- kubectl get pods ${namespace} --selector=app=$1 --output=jsonpath="{.items[0].metadata.name}"
+ local pods=($(get_app_pods $1 $2))
+ echo "${pods[0]}"
}
# Returns the name of all pods of the given app.
