diff --git a/grafana/Chart.yaml b/grafana/Chart.yaml index 46da6dfb2..c77b51ac4 100644 --- a/grafana/Chart.yaml +++ b/grafana/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v7.4.5 description: OpenStack-Helm Grafana name: grafana -version: 0.1.13 +version: 0.1.14 home: https://grafana.com/ sources: - https://github.com/grafana/grafana diff --git a/grafana/templates/bin/_grafana.sh.tpl b/grafana/templates/bin/_grafana.sh.tpl index db8c98bbf..0c5ad8fdb 100644 --- a/grafana/templates/bin/_grafana.sh.tpl +++ b/grafana/templates/bin/_grafana.sh.tpl @@ -13,15 +13,29 @@ See the License for the specific language governing permissions and limitations under the License. */}} -set -ex +set -exo pipefail COMMAND="${@:-start}" +PORT={{ tuple "grafana" "internal" "grafana" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} +PIDFILE=/tmp/pid function start () { - exec /usr/share/grafana/bin/grafana-server -homepath=/usr/share/grafana -config=/etc/grafana/grafana.ini + exec /usr/share/grafana/bin/grafana-server -homepath=/usr/share/grafana -config=/etc/grafana/grafana.ini --pidfile="$PIDFILE" +} + +function run_migrator () { + start & + timeout 60 bash -c "until timeout 5 bash -c '