ref(create): don't render empty resource fields

Signed-off-by: Denis Krivenko <dnskrv88@gmail.com>
Signed-off-by: dnskr <dnskrv88@gmail.com>
pull/13232/head
dnskr 5 months ago
parent 145d12f82f
commit 81c6a9085c

@ -327,24 +327,34 @@ spec:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "<CHARTNAME>.serviceAccountName" . }} serviceAccountName: {{ include "<CHARTNAME>.serviceAccountName" . }}
{{- with .Values.podSecurityContext }}
securityContext: securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }} {{- toYaml . | nindent 8 }}
{{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
{{- with .Values.securityContext }}
securityContext: securityContext:
{{- toYaml .Values.securityContext | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
ports: ports:
- name: http - name: http
containerPort: {{ .Values.service.port }} containerPort: {{ .Values.service.port }}
protocol: TCP protocol: TCP
{{- with .Values.livenessProbe }}
livenessProbe: livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe: readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.resources }}
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumeMounts }} {{- with .Values.volumeMounts }}
volumeMounts: volumeMounts:
{{- toYaml . | nindent 12 }} {{- toYaml . | nindent 12 }}

Loading…
Cancel
Save