[bitnami/kibana] Fix is_kibana_running function (#3479)
* Fix is_kibana_running function Signed-off-by: Anthony Day <aday@cyral.com> * Update status check to cover Kibana 7 & 8 Signed-off-by: Anthony Day <aday@cyral.com> * Simplify logic Signed-off-by: Anthony Day <aday@cyral.com> Signed-off-by: Anthony Day <aday@cyral.com>
This commit is contained in:
parent
80ea88bc99
commit
327928dc57
|
|
@ -310,8 +310,9 @@ is_kibana_ready() {
|
|||
# Therefore, we must check the value is not 'true'
|
||||
[[ ! "$rewriteBasePath" = "false" ]] && basePath=$(kibana_conf_get "server.basePath")
|
||||
if is_kibana_running; then
|
||||
local -r state="$(yq eval ".status.overall.state" - <<<"$(curl -s "127.0.0.1:${KIBANA_PORT_NUMBER}${basePath:-}/api/status")")"
|
||||
[[ "$state" = "green" ]]
|
||||
# Kibana 7 expects .status.overall.state to be 'green', while 8 expects .status.overall.level to be 'available'
|
||||
local -r status="$(yq eval '.status.overall | pick(["state", "level"]) | .[]' - <<<"$(curl -s "127.0.0.1:${KIBANA_PORT_NUMBER}${basePath:-}/api/status")")"
|
||||
[[ "$status" = "green" || "$status" = "available" ]] && return
|
||||
else
|
||||
false
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -310,8 +310,9 @@ is_kibana_ready() {
|
|||
# Therefore, we must check the value is not 'true'
|
||||
[[ ! "$rewriteBasePath" = "false" ]] && basePath=$(kibana_conf_get "server.basePath")
|
||||
if is_kibana_running; then
|
||||
local -r state="$(yq eval ".status.overall.state" - <<<"$(curl -s "127.0.0.1:${KIBANA_PORT_NUMBER}${basePath:-}/api/status")")"
|
||||
[[ "$state" = "green" ]]
|
||||
# Kibana 7 expects .status.overall.state to be 'green', while 8 expects .status.overall.level to be 'available'
|
||||
local -r status="$(yq eval '.status.overall | pick(["state", "level"]) | .[]' - <<<"$(curl -s "127.0.0.1:${KIBANA_PORT_NUMBER}${basePath:-}/api/status")")"
|
||||
[[ "$status" = "green" || "$status" = "available" ]] && return
|
||||
else
|
||||
false
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue