Skip to content

Commit

Permalink
[Chore] format some template yaml files in helm chart (#501)
Browse files Browse the repository at this point in the history
Signed-off-by: yandongxiao <[email protected]>
  • Loading branch information
yandongxiao authored Apr 7, 2024
1 parent 5b92787 commit 8fb1cca
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ starrockscluster
{{- define "starrockscluster.fe.config" -}}
fe.conf: |
{{- if .Values.starrocksFESpec.config }}
{{ .Values.starrocksFESpec.config | indent 2 }}
{{- .Values.starrocksFESpec.config | nindent 2 }}
{{- end }}
{{- end }}

{{- define "starrockscluster.cn.config" -}}
cn.conf: |
{{- if .Values.starrocksCnSpec.config | indent 2 }}
{{ .Values.starrocksCnSpec.config | indent 2 }}
{{- if .Values.starrocksCnSpec.config }}
{{- .Values.starrocksCnSpec.config | nindent 2 }}
{{- end }}
{{- end }}

{{- define "starrocksclster.be.config" -}}
be.conf: |
{{- if .Values.starrocksBeSpec.config | indent 2 }}
{{ .Values.starrocksBeSpec.config | indent 2 }}
{{- if .Values.starrocksBeSpec.config }}
{{- .Values.starrocksBeSpec.config | nindent 2 }}
{{- end }}
{{- end }}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
cluster: {{ template "starrockscluster.name" . }}
app: "be"
data:
{{ include "starrocksclster.be.config" . | indent 2 }}
{{- include "starrocksclster.be.config" . | nindent 2 }}

{{- end }}

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ metadata:
cluster: {{ template "starrockscluster.name" . }}
app: "cn"
data:
{{ include "starrockscluster.cn.config" . | indent 2 }}
{{- include "starrockscluster.cn.config" . | nindent 2 }}

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ metadata:
cluster: {{ template "starrockscluster.name" . }}
app: "fe"
data:
{{ include "starrockscluster.fe.config" . | indent 2 }}
{{- include "starrockscluster.fe.config" . | nindent 2 }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ metadata:
namespace: {{ template "starrockscluster.namespace" . }}
labels:
cluster: {{ template "starrockscluster.name" . }}
{{- include "starrockscluster.labels" . | nindent 4 }}
{{- if .Values.starrocksCluster.annotations }}
{{- include "starrockscluster.labels" . | nindent 4 }}
{{- if .Values.starrocksCluster.annotations }}
annotations:
{{ toYaml .Values.starrocksCluster.annotations | nindent 4 }}
{{- end }}
{{- toYaml .Values.starrocksCluster.annotations | nindent 4 }}
{{- end }}
spec:
starRocksFeSpec:
image: "{{ .Values.starrocksFESpec.image.repository }}:{{ include "starrockscluster.fe.image.tag" . }}"
Expand Down Expand Up @@ -53,9 +53,9 @@ spec:
ad.datadoghq.com/fe.logs: {{ printf "[%s]" (printf "{%s, \"source\": \"fe\", \"service\": \"starrocks\"}" (trimAll " {}" .Values.datadog.log.logConfig) | fromJson | toJson) | squote }}
{{- end }}
{{- end }}
{{- if .Values.starrocksFESpec.annotations }}
{{ toYaml .Values.starrocksFESpec.annotations | indent 6 }}
{{- end }}
{{- if .Values.starrocksFESpec.annotations }}
{{- toYaml .Values.starrocksFESpec.annotations | nindent 6 }}
{{- end }}
{{- if or .Values.starrocksFESpec.imagePullSecrets .Values.starrocksCluster.componentValues.imagePullSecrets }}
imagePullSecrets:
{{- include "starrockscluster.fe.imagePullSecrets" . | nindent 6 }}
Expand Down Expand Up @@ -161,22 +161,22 @@ spec:
sidecars:
{{- toYaml .Values.starrocksFESpec.sidecars | nindent 6 }}
{{- end }}
{{- if .Values.starrocksFESpec.secrets }}
{{- if .Values.starrocksFESpec.secrets }}
secrets:
{{- range .Values.starrocksFESpec.secrets }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- if .Values.starrocksFESpec.configMaps }}
{{- end }}
{{- if .Values.starrocksFESpec.configMaps }}
configMaps:
{{- range .Values.starrocksFESpec.configMaps }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
configMapInfo:
configMapName: {{ template "starrockscluster.fe.configmap.name" . }}
resolveKey: fe.conf
Expand Down Expand Up @@ -210,7 +210,7 @@ spec:
{{- end }}
{{- end }}

{{- if .Values.starrocksCluster.enabledBe }}
{{- if .Values.starrocksCluster.enabledBe }}
starRocksBeSpec:
image: "{{ .Values.starrocksBeSpec.image.repository }}:{{ include "starrockscluster.be.image.tag" . }}"
replicas: {{ .Values.starrocksBeSpec.replicas }}
Expand Down Expand Up @@ -253,9 +253,9 @@ spec:
ad.datadoghq.com/be.logs: {{ printf "[%s]" (printf "{%s, \"source\": \"be\", \"service\": \"starrocks\"}" (trimAll " {}" .Values.datadog.log.logConfig) | fromJson | toJson) | squote }}
{{- end }}
{{- end }}
{{- if .Values.starrocksBeSpec.annotations }}
{{ toYaml .Values.starrocksBeSpec.annotations | indent 6 }}
{{- end }}
{{- if .Values.starrocksBeSpec.annotations }}
{{- toYaml .Values.starrocksBeSpec.annotations | nindent 6 }}
{{- end }}
{{- if or .Values.starrocksBeSpec.imagePullSecrets .Values.starrocksCluster.componentValues.imagePullSecrets }}
imagePullSecrets:
{{- include "starrockscluster.be.imagePullSecrets" . | nindent 6 }}
Expand Down Expand Up @@ -374,22 +374,22 @@ spec:
sidecars:
{{- toYaml .Values.starrocksBeSpec.sidecars | nindent 6 }}
{{- end }}
{{- if .Values.starrocksBeSpec.secrets }}
{{- if .Values.starrocksBeSpec.secrets }}
secrets:
{{- range .Values.starrocksBeSpec.secrets }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- if .Values.starrocksBeSpec.configMaps }}
{{- end }}
{{- if .Values.starrocksBeSpec.configMaps }}
configMaps:
{{- range .Values.starrocksBeSpec.configMaps }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
configMapInfo:
configMapName: {{template "starrockscluster.be.configmap.name" . }}
resolveKey: be.conf
Expand Down Expand Up @@ -423,7 +423,7 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.starrocksCluster.enabledCn }}
{{- if .Values.starrocksCluster.enabledCn }}
starRocksCnSpec:
image: "{{ .Values.starrocksCnSpec.image.repository }}:{{ include "starrockscluster.cn.image.tag" . }}"
{{- if .Values.starrocksCnSpec.replicas }}
Expand Down Expand Up @@ -587,29 +587,29 @@ spec:
ad.datadoghq.com/cn.logs: {{ printf "[%s]" (printf "{%s, \"source\": \"cn\", \"service\": \"starrocks\"}" (trimAll " {}" .Values.datadog.log.logConfig) | fromJson | toJson) | squote }}
{{- end }}
{{- end }}
{{- if .Values.starrocksCnSpec.annotations }}
{{ toYaml .Values.starrocksCnSpec.annotations | indent 6 }}
{{- end }}
{{- if .Values.starrocksCnSpec.annotations }}
{{- toYaml .Values.starrocksCnSpec.annotations | nindent 6 }}
{{- end }}
{{- if or .Values.starrocksCnSpec.imagePullSecrets .Values.starrocksCluster.componentValues.imagePullSecrets }}
imagePullSecrets:
{{- include "starrockscluster.cn.imagePullSecrets" . | nindent 6 }}
{{- end }}
{{- if .Values.starrocksCnSpec.secrets }}
{{- if .Values.starrocksCnSpec.secrets }}
secrets:
{{- range .Values.starrocksCnSpec.secrets }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- if .Values.starrocksCnSpec.configMaps }}
{{- end }}
{{- if .Values.starrocksCnSpec.configMaps }}
configMaps:
{{- range .Values.starrocksCnSpec.configMaps }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
{{- end }}
{{- end }}
{{- end }}
configMapInfo:
configMapName: {{template "starrockscluster.cn.configmap.name" . }}
resolveKey: cn.conf
Expand Down
4 changes: 2 additions & 2 deletions helm-charts/charts/warehouse/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}

{{- define "starrockswarehouse.config" -}}
cn.conf: |
{{- if .Values.spec.config | indent 2 }}
{{ .Values.spec.config | indent 2 }}
{{- if .Values.spec.config }}
{{- .Values.spec.config | nindent 2 }}
{{- end }}
{{- end }}

Expand Down
2 changes: 1 addition & 1 deletion helm-charts/charts/warehouse/templates/cnconfigmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ metadata:
warehouse: {{ template "starrockswarehouse.name" . }}
app: "warehouse"
data:
{{ include "starrockswarehouse.config" . | indent 2 }}
{{- include "starrockswarehouse.config" . | nindent 2 }}

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ spec:
{{- end }}
{{- end }}
{{- if .Values.spec.annotations }}
{{ toYaml .Values.spec.annotations | indent 6 }}
{{- toYaml .Values.spec.annotations | nindent 6 }}
{{- end }}
{{- if .Values.spec.imagePullSecrets }}
imagePullSecrets:
Expand Down

0 comments on commit 8fb1cca

Please sign in to comment.