Skip to content

Commit

Permalink
fix(base-cluster): only toYaml if field exists (#1226)
Browse files Browse the repository at this point in the history
otherwise `{}` will be inserted, breaking everything
  • Loading branch information
cwrau authored Nov 13, 2024
1 parent b9b2154 commit d81cd38
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions charts/base-cluster/templates/_helmRelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ metadata:
name: {{ .name }}
namespace: {{ .namespace | default .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- with .additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .additionalLabels }}{{- toYaml . | nindent 4 }}{{- end }}
spec:
chart:
spec: {{- include "base-cluster.helm.chartSpec" (dict "repo" "cetic" "chart" "static" "context" .context) | nindent 6 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
name: certificate-expiration
namespace: cert-manager
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- toYaml .Values.monitoring.labels | nindent 4 }}
{{- with .Values.monitoring.labels }}{{ toYaml . | nindent 4 }}{{- end }}
app.kubernetes.io/component: prometheus
app.kubernetes.io/part-of: cert-manager
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/flux/podMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
name: flux
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- toYaml .Values.monitoring.labels | nindent 4 }}
{{- with .Values.monitoring.labels }}{{- toYaml . | nindent 4 }}{{- end }}
app.kubernetes.io/component: prometheus
app.kubernetes.io/part-of: flux
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/base-cluster/templates/flux/rules/flux-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
name: flux-status
namespace: {{ .Release.Namespace }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- toYaml .Values.monitoring.labels | nindent 4 }}
{{- with .Values.monitoring.labels }}{{- toYaml . | nindent 4 }}{{- end }}
app.kubernetes.io/component: prometheus
app.kubernetes.io/part-of: flux
spec:
Expand Down
4 changes: 1 addition & 3 deletions charts/base-cluster/templates/global/namespaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ kind: Namespace
metadata:
name: {{ $name }}
labels: {{- include "common.labels.standard" $ | nindent 4 -}}
{{- with $namespace.additionalLabels -}}
{{- toYaml . | nindent 4 -}}
{{- end }}
{{- with $namespace.additionalLabels -}}{{- toYaml . | nindent 4 -}}{{- end }}
---
apiVersion: v1
kind: LimitRange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
name: storage-size
namespace: nfs-server-provisioner
labels: {{- include "common.labels.standard" $ | nindent 4 }}
{{- toYaml .Values.monitoring.labels | nindent 4 }}
{{- with .Values.monitoring.labels }}{{- toYaml . | nindent 4 }}{{- end }}
app.kubernetes.io/component: prometheus
app.kubernetes.io/part-of: nfs-server-provisioner
spec:
Expand Down

0 comments on commit d81cd38

Please sign in to comment.