From 69dd20af668dca7715fbab7f4c6c5b95cabe21a8 Mon Sep 17 00:00:00 2001 From: Engin Diri Date: Fri, 1 Apr 2022 19:28:29 +0200 Subject: [PATCH] Fix4 (#101) * fix: add Release.Namespace to svc url Signed-off-by: Engin Diri --- charts/node-red/Chart.yaml | 4 ++-- charts/node-red/README.md | 4 ++-- charts/node-red/scripts/flow_refresh.sh | 2 +- charts/node-red/templates/deployment.yaml | 2 +- charts/node-red/tests/deployment_test.yaml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/charts/node-red/Chart.yaml b/charts/node-red/Chart.yaml index 87a9b541..724cf587 100644 --- a/charts/node-red/Chart.yaml +++ b/charts/node-red/Chart.yaml @@ -9,7 +9,7 @@ icon: https://nodered.org/about/resources/media/node-red-icon-2.png type: application -version: 0.15.3 +version: 0.15.4 appVersion: 2.2.2 keywords: @@ -29,7 +29,7 @@ maintainers: annotations: artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/changes: | - - fix defaultMode on refresh script + - fix the internal svc url artifacthub.io/images: | - name: node-red image: docker.io/nodered/node-red:2.2.2 diff --git a/charts/node-red/README.md b/charts/node-red/README.md index aba43aeb..7fcb9012 100644 --- a/charts/node-red/README.md +++ b/charts/node-red/README.md @@ -1,6 +1,6 @@ # node-red ⚙ -![Version: 0.15.3](https://img.shields.io/badge/Version-0.15.3-informational?style=for-the-badge) +![Version: 0.15.4](https://img.shields.io/badge/Version-0.15.4-informational?style=for-the-badge) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=for-the-badge) ![AppVersion: 2.2.2](https://img.shields.io/badge/AppVersion-2.2.2-informational?style=for-the-badge) @@ -26,7 +26,7 @@ helm repo update To install the chart with the release name node-red run: ```bash -helm install node-red node-red/node-red --version 0.15.3 +helm install node-red node-red/node-red --version 0.15.4 ``` After a few seconds, node-red should be running. diff --git a/charts/node-red/scripts/flow_refresh.sh b/charts/node-red/scripts/flow_refresh.sh index b473fc34..66c913f5 100644 --- a/charts/node-red/scripts/flow_refresh.sh +++ b/charts/node-red/scripts/flow_refresh.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh echo "node-red flow refresh api" sleep $SLEEP_TIME_SIDECAR token=$(curl -X POST -sSk --connect-timeout 30 --retry 50 --retry-delay 10 --data "client_id=node-red-admin&grant_type=password&scope=*&username=$USERNAME&password=$PASSWORD" $URL/auth/token | grep "^{" | jq -r .access_token) diff --git a/charts/node-red/templates/deployment.yaml b/charts/node-red/templates/deployment.yaml index fae20f7d..88ca663d 100644 --- a/charts/node-red/templates/deployment.yaml +++ b/charts/node-red/templates/deployment.yaml @@ -77,7 +77,7 @@ spec: value: /app/{{ .Values.sidecar.env.script }} {{- end }} - name: URL - value: {{ printf "http://%s.svc.cluster.local:%d" (include "node-red.fullname" .) (.Values.service.port | int) }} + value: {{ printf "http://%s.%s.svc.cluster.local:%d" (include "node-red.fullname" .) .Release.Namespace (.Values.service.port | int) }} - name: USERNAME value: {{ required "please set the username for API refresh call" .Values.sidecar.env.username }} {{- if or .Values.sidecar.env.password .Values.sidecar.env.passwordFromExistingSecret }} diff --git a/charts/node-red/tests/deployment_test.yaml b/charts/node-red/tests/deployment_test.yaml index cf3100ab..23d405e3 100644 --- a/charts/node-red/tests/deployment_test.yaml +++ b/charts/node-red/tests/deployment_test.yaml @@ -30,7 +30,7 @@ tests: value: /app/flow_refresh.sh - equal: path: spec.template.spec.containers[0].env[6].value - value: http://RELEASE-NAME-node-red.svc.cluster.local:1880 + value: http://RELEASE-NAME-node-red.NAMESPACE.svc.cluster.local:1880 - equal: path: spec.template.spec.containers[0].env[7].value value: x