[template] Fix usage of common.tplvalues.merge partial (#20964)

* [template] Fix usage of common.tplvalues.merge partial

Signed-off-by: Max Nitze <max.nitze@mgm-tp.com>

* [template] Remove unnecessary fromYaml in usages of common.tplvalues.merge partial

Signed-off-by: Max Nitze <max.nitze@mgm-tp.com>

---------

Signed-off-by: Max Nitze <max.nitze@mgm-tp.com>
Co-authored-by: Max Nitze <max.nitze@mgm-tp.com>
This commit is contained in:
Max Nitze
2023-12-04 10:43:47 +01:00
committed by GitHub
parent 725a8474df
commit 57be4f09ed
9 changed files with 13 additions and 13 deletions

View File

@@ -11,14 +11,14 @@ metadata:
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if or .Values.%%MAIN_OBJECT_BLOCK%%.daemonsetAnnotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.daemonsetAnnotations .Values.commonAnnotations "context" .) | fromYaml }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.%%MAIN_OBJECT_BLOCK%%.daemonsetAnnotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.updateStrategy }}
updateStrategy: {{- toYaml .Values.%%MAIN_OBJECT_BLOCK%%.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.podLabels .Values.commonLabels "context" .) | fromYaml }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.%%MAIN_OBJECT_BLOCK%%.podLabels .Values.commonLabels) "context" .) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%

View File

@@ -11,7 +11,7 @@ metadata:
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if or .Values.%%MAIN_OBJECT_BLOCK%%.deploymentAnnotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.deploymentAnnotations .Values.commonAnnotations "context" .) | fromYaml }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.%%MAIN_OBJECT_BLOCK%%.deploymentAnnotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
@@ -21,7 +21,7 @@ spec:
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.updateStrategy }}
strategy: {{- toYaml .Values.%%MAIN_OBJECT_BLOCK%%.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.podLabels .Values.commonLabels "context" .) | fromYaml }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.%%MAIN_OBJECT_BLOCK%%.podLabels .Values.commonLabels) "context" .) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%

View File

@@ -12,7 +12,7 @@ metadata:
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if or .Values.ingress.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.ingress.annotations .Values.commonAnnotations "context" .) | fromYaml }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.ingress.annotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:

View File

@@ -22,7 +22,7 @@ spec:
{{- if .Values.%%MAIN_OBJECT_BLOCK%%.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.%%MAIN_OBJECT_BLOCK%%.pdb.maxUnavailable }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.podLabels .Values.commonLabels "context" .) | fromYaml }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.%%MAIN_OBJECT_BLOCK%%.podLabels .Values.commonLabels) "context" .) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%

View File

@@ -12,7 +12,7 @@ metadata:
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if or .Values.persistence.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.persistence.annotations .Values.commonAnnotations "context" .) | fromYaml }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.persistence.annotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:

View File

@@ -12,7 +12,7 @@ metadata:
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if or .Values.serviceAccount.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.serviceAccount.annotations .Values.commonAnnotations "context" .) | fromYaml }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.serviceAccount.annotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}

View File

@@ -11,7 +11,7 @@ metadata:
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if or .Values.service.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.service.annotations .Values.commonAnnotations "context" .) | fromYaml }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.service.annotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:

View File

@@ -9,11 +9,11 @@ kind: ServiceMonitor
metadata:
name: {{ include "common.names.fullname" . }}
namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace | quote }}
{{- $labels := include "common.tplvalues.merge" (dict "values" .Values.metrics.serviceMonitor.labels .Values.commonLabels "context" .) | fromYaml }}
{{- $labels := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.serviceMonitor.labels .Values.commonLabels) "context" .) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if or .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations "context" .) | fromYaml }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.serviceMonitor.annotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:

View File

@@ -11,7 +11,7 @@ metadata:
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%
{{- if or .Values.%%MAIN_OBJECT_BLOCK%%.statefulsetAnnotations .Values.commonAnnotations }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.statefulsetAnnotations .Values.commonAnnotations "context" .) | fromYaml }}
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.%%MAIN_OBJECT_BLOCK%%.statefulsetAnnotations .Values.commonAnnotations) "context" .) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
@@ -19,7 +19,7 @@ spec:
replicas: {{ .Values.replicaCount }}
{{- end }}
podManagementPolicy: {{ .Values.podManagementPolicy | quote }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" .Values.%%MAIN_OBJECT_BLOCK%%.podLabels .Values.commonLabels "context" .) | fromYaml }}
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.%%MAIN_OBJECT_BLOCK%%.podLabels .Values.commonLabels) "context" .) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: %%COMPONENT_NAME%%