X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fcaas-logging.git;a=blobdiff_plain;f=docker-build%2Felasticsearch%2Fhealthcheck;fp=docker-build%2Felasticsearch%2Fhealthcheck;h=0000000000000000000000000000000000000000;hp=5d1c971e8541f2dfd8b92215ae5d847a993a8f80;hb=dbb52626787b945265e4dbfaee8a2905fa410b67;hpb=e44199dbf3af9d714be1e8717707eb8ad661239f diff --git a/docker-build/elasticsearch/healthcheck b/docker-build/elasticsearch/healthcheck deleted file mode 100644 index 5d1c971..0000000 --- a/docker-build/elasticsearch/healthcheck +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# Copyright 2019 Nokia -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -eo pipefail - -host="$(hostname --ip-address || echo '127.0.0.1')" - -if health="$(curl -fsSL "http://$host:${ELASTICSEARCH_PORT}/_cat/health?h=status")"; then - health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") - if [ "$health" = 'green' ]; then - exit 0 - fi - echo >&2 "unexpected health status: $health" -fi - -# If the probe returns 2 ("starting") when the container has already moved out of the "starting" state then it is treated as "unhealthy" instead. -# https://github.com/docker/docker/blob/dcc65376bac8e73bb5930fce4cddc2350bb7baa2/docs/reference/builder.md#healthcheck -exit 2