[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
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Change-Id: Ia8cead50d305adb00eef666d0a1ace74479b5183
diff --git a/kubernetes/common/postgres/templates/configmap.yaml b/kubernetes/common/postgres/templates/configmap.yaml
index 7abd39b..26ba390 100644
--- a/kubernetes/common/postgres/templates/configmap.yaml
+++ b/kubernetes/common/postgres/templates/configmap.yaml
@@ -20,7 +20,7 @@
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 "configs/*").AsConfig . | indent 2 }}
diff --git a/kubernetes/common/postgres/templates/deployment-primary.yaml b/kubernetes/common/postgres/templates/deployment-primary.yaml
index 9cb3007..b234dc2 100644
--- a/kubernetes/common/postgres/templates/deployment-primary.yaml
+++ b/kubernetes/common/postgres/templates/deployment-primary.yaml
@@ -21,7 +21,7 @@
labels:
app: {{ include "common.name" . }}-primary
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
name: "{{ .Values.container.name.primary }}"
spec:
@@ -31,7 +31,7 @@
metadata:
labels:
app: {{ include "common.name" . }}-primary
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
name: "{{ .Values.container.name.primary }}"
spec:
initContainers:
diff --git a/kubernetes/common/postgres/templates/deployment-replica.yaml b/kubernetes/common/postgres/templates/deployment-replica.yaml
index 8f09a2f..72a8736 100644
--- a/kubernetes/common/postgres/templates/deployment-replica.yaml
+++ b/kubernetes/common/postgres/templates/deployment-replica.yaml
@@ -21,7 +21,7 @@
labels:
app: {{ include "common.name" . }}-replica
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
name: "{{ .Values.container.name.replica }}"
spec:
@@ -31,7 +31,7 @@
metadata:
labels:
app: {{ include "common.name" . }}-replica
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
name: "{{ .Values.container.name.replica }}"
spec:
initContainers:
diff --git a/kubernetes/common/postgres/templates/pv-primary.yaml b/kubernetes/common/postgres/templates/pv-primary.yaml
index 1764868..e1ff1f9 100644
--- a/kubernetes/common/postgres/templates/pv-primary.yaml
+++ b/kubernetes/common/postgres/templates/pv-primary.yaml
@@ -23,7 +23,7 @@
labels:
app: {{ include "common.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
- release: "{{ .Release.Name }}"
+ release: "{{ include "common.release" . }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
spec:
@@ -34,6 +34,6 @@
storageClassName: "{{ include "common.fullname" . }}-primary"
persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
hostPath:
- path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/primary
+ path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPath }}/primary
{{- end -}}
{{- end -}}
diff --git a/kubernetes/common/postgres/templates/pv-replica.yaml b/kubernetes/common/postgres/templates/pv-replica.yaml
index b67cac0..d553c36 100644
--- a/kubernetes/common/postgres/templates/pv-replica.yaml
+++ b/kubernetes/common/postgres/templates/pv-replica.yaml
@@ -23,7 +23,7 @@
labels:
app: {{ include "common.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
- release: "{{ .Release.Name }}"
+ release: "{{ include "common.release" . }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
spec:
@@ -34,6 +34,6 @@
storageClassName: "{{ include "common.fullname" . }}-replica"
persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
hostPath:
- path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/replica
+ path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ include "common.release" . }}/{{ .Values.persistence.mountSubPath }}/replica
{{- end -}}
{{- end -}}
diff --git a/kubernetes/common/postgres/templates/pvc-primary.yaml b/kubernetes/common/postgres/templates/pvc-primary.yaml
index e529da1..fa25f19 100644
--- a/kubernetes/common/postgres/templates/pvc-primary.yaml
+++ b/kubernetes/common/postgres/templates/pvc-primary.yaml
@@ -23,7 +23,7 @@
labels:
app: {{ include "common.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
- release: "{{ .Release.Name }}"
+ release: "{{ include "common.release" . }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
{{- if .Values.persistence.annotations }}
diff --git a/kubernetes/common/postgres/templates/pvc-replica.yaml b/kubernetes/common/postgres/templates/pvc-replica.yaml
index 41199b6..1e453fb 100644
--- a/kubernetes/common/postgres/templates/pvc-replica.yaml
+++ b/kubernetes/common/postgres/templates/pvc-replica.yaml
@@ -23,7 +23,7 @@
labels:
app: {{ include "common.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
- release: "{{ .Release.Name }}"
+ release: "{{ include "common.release" . }}"
heritage: "{{ .Release.Service }}"
name: {{ include "common.fullname" . }}
{{- if .Values.persistence.annotations }}
diff --git a/kubernetes/common/postgres/templates/secrets.yaml b/kubernetes/common/postgres/templates/secrets.yaml
index 29de3af..db1bc5b 100644
--- a/kubernetes/common/postgres/templates/secrets.yaml
+++ b/kubernetes/common/postgres/templates/secrets.yaml
@@ -21,7 +21,7 @@
labels:
app: {{ include "common.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
type: Opaque
data:
diff --git a/kubernetes/common/postgres/templates/service-common.yaml b/kubernetes/common/postgres/templates/service-common.yaml
index da0505c..6e74a06 100644
--- a/kubernetes/common/postgres/templates/service-common.yaml
+++ b/kubernetes/common/postgres/templates/service-common.yaml
@@ -21,7 +21,7 @@
labels:
app: {{ include "common.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
annotations:
spec:
@@ -38,4 +38,4 @@
{{- end}}
selector:
app: {{ include "common.name" . }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
diff --git a/kubernetes/common/postgres/templates/service-primary.yaml b/kubernetes/common/postgres/templates/service-primary.yaml
index 501c01e..2965b7d 100644
--- a/kubernetes/common/postgres/templates/service-primary.yaml
+++ b/kubernetes/common/postgres/templates/service-primary.yaml
@@ -21,7 +21,7 @@
labels:
app: {{ include "common.name" . }}-primary
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
annotations:
spec:
@@ -38,4 +38,4 @@
{{- end}}
selector:
name: "{{.Values.container.name.primary}}"
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
diff --git a/kubernetes/common/postgres/templates/service-replica.yaml b/kubernetes/common/postgres/templates/service-replica.yaml
index 34f76d1..d92a083 100644
--- a/kubernetes/common/postgres/templates/service-replica.yaml
+++ b/kubernetes/common/postgres/templates/service-replica.yaml
@@ -21,7 +21,7 @@
labels:
app: {{ include "common.name" . }}-replica
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}
heritage: {{ .Release.Service }}
annotations:
spec:
@@ -38,4 +38,4 @@
{{- end}}
selector:
name: "{{.Values.container.name.replica}}"
- release: {{ .Release.Name }}
+ release: {{ include "common.release" . }}