From df719f4a3e63cff0d5d832945f0b8ba18230635c Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Fri, 24 Jan 2020 23:40:01 +0100 Subject: [ONAP-wide] Replace .Release.Name with common.release ONAP is too big to be deployed using helm install so we need to use a custom helm plugin helm deploy. This script deloys onap component by component instead of deploying evrything at once. Unfortunately this script also modifies the helm release by appending component name to it. As a result of this behavior our objects are called for example: onap-mariadb-galera-mariadb-galera-0 instead of just being called onap-mariadb-galera-0. This patch simplifies this naming convention by replacing all direct usages of .Release.Name with common.release macro which strips the component specific part from the release name. Issue-ID: OOM-2275 Change-Id: I3384bf30c663764339b0b41527ca4eb7168f0d49 Signed-off-by: Krzysztof Opasiak --- templates/configmap.yaml | 2 +- templates/deployment.yaml | 4 ++-- templates/pv.yaml | 4 ++-- templates/pvc.yaml | 2 +- templates/service.yaml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/configmap.yaml b/templates/configmap.yaml index da50934..a0d01ea 100644 --- a/templates/configmap.yaml +++ b/templates/configmap.yaml @@ -20,7 +20,7 @@ metadata: labels: app: {{ include "common.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} + release: {{ include "common.release" . }} heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/eteshare/config/*").AsConfig . | indent 2 }} diff --git a/templates/deployment.yaml b/templates/deployment.yaml index e582119..34c36e3 100644 --- a/templates/deployment.yaml +++ b/templates/deployment.yaml @@ -20,7 +20,7 @@ metadata: labels: app: {{ include "common.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} + release: {{ include "common.release" . }} heritage: {{ .Release.Service }} spec: replicas: {{ .Values.replicaCount }} @@ -28,7 +28,7 @@ spec: metadata: labels: app: {{ include "common.name" . }} - release: {{ .Release.Name }} + release: {{ include "common.release" . }} spec: hostAliases: - ip: {{ .Values.kubernetesExternalIp }} diff --git a/templates/pv.yaml b/templates/pv.yaml index 63829cb..1226402 100644 --- a/templates/pv.yaml +++ b/templates/pv.yaml @@ -24,7 +24,7 @@ metadata: labels: app: {{ include "common.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" - release: "{{ .Release.Name }}" + release: {{ include "common.release" . }} heritage: "{{ .Release.Service }}" name: {{ include "common.fullname" . }} spec: @@ -35,6 +35,6 @@ spec: storageClassName: "{{ include "common.fullname" . }}-data" persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }} hostPath: - path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }} + path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPath }} {{- end -}} {{- end -}} diff --git a/templates/pvc.yaml b/templates/pvc.yaml index e21babb..6c18ca0 100644 --- a/templates/pvc.yaml +++ b/templates/pvc.yaml @@ -23,7 +23,7 @@ metadata: labels: app: {{ include "common.name" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" + release: {{ include "common.release" . }} heritage: "{{ .Release.Service }}" {{- if .Values.persistence.annotations }} annotations: diff --git a/templates/service.yaml b/templates/service.yaml index 3fc21b4..d1e3bec 100644 --- a/templates/service.yaml +++ b/templates/service.yaml @@ -20,7 +20,7 @@ metadata: labels: app: {{ include "common.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} + release: {{ include "common.release" . }} heritage: {{ .Release.Service }} spec: type: {{ .Values.service.type }} @@ -36,4 +36,4 @@ spec: {{- end}} selector: app: {{ include "common.name" . }} - release: {{ .Release.Name }} \ No newline at end of file + release: {{ include "common.release" . }} -- cgit 1.2.3-korg