I've fixed the Helm lint errors in the iperf3-monitor chart.

This involved addressing several Helm linting issues I identified in the iperf3-monitor chart.

Here's what I changed:
- I corrected a syntax error (an unexpected backslash) in the label value within `charts/iperf3-monitor/templates/exporter-deployment.yaml`.
- I resolved a missing dependency by:
    - Adding the `prometheus-community` Helm repository.
    - Updating the dependency name in `Chart.yaml` to `kube-prometheus-stack` when a repository URL is specified.
    - Running `helm dependency update` to fetch the `kube-prometheus-stack` dependency.
- I fixed YAML parsing errors in `charts/iperf3-monitor/templates/exporter-deployment.yaml` caused by incorrect newline handling in the Helm helper templates (`charts/iperf3-monitor/templates/_helpers.tpl`). This involved:
    - Ensuring the `iperf3-monitor.selectorLabels` helper template output ends with a newline.
    - Adjusting whitespace control in the `iperf3-monitor.labels` helper template to preserve newlines between label entries.
- I restored the `app.kubernetes.io/component: exporter` label to the top-level metadata in `charts/iperf3-monitor/templates/exporter-deployment.yaml`.

After these modifications, `helm lint charts/iperf3-monitor` passes without any errors or warnings.
This commit is contained in:
google-labs-jules[bot]
2025-06-19 20:45:00 +00:00
parent 774afbab70
commit c08f4a5667
6 changed files with 358 additions and 5 deletions

View File

@@ -0,0 +1,6 @@
dependencies:
- name: kube-prometheus-stack
repository: https://prometheus-community.github.io/helm-charts
version: 75.3.6
digest: sha256:d15acd48bfc0b842654ae025e1bd1969e636a66508020312d555db84f381c379
generated: "2025-06-19T20:40:53.415529365Z"

View File

@@ -24,7 +24,7 @@ annotations:
- Add initial Helm chart structure.
artifacthub.io/category: networking
dependencies:
- name: prometheus-community/kube-prometheus-stack # Example dependency if you package the whole stack
- name: kube-prometheus-stack # Example dependency if you package the whole stack
version: ">=30.0.0" # Specify a compatible version range
repository: https://prometheus-community.github.io/helm-charts
condition: serviceMonitor.enabled # Only include if ServiceMonitor is enabled (assuming Prometheus Operator)

View File

@@ -29,9 +29,9 @@ Create chart's labels
{{- define "iperf3-monitor.labels" -}}
helm.sh/chart: {{ include "iperf3-monitor.name" . }}-{{ .Chart.Version | replace "+" "_" }}
{{ include "iperf3-monitor.selectorLabels" . }}
{{- if .Chart.AppVersion -}}
{{ if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end -}}
{{ end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
@@ -41,7 +41,7 @@ Selector labels
{{- define "iperf3-monitor.selectorLabels" -}}
app.kubernetes.io/name: {{ include "iperf3-monitor.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{ end }}
{{/*
Create the name of the service account to use

View File

@@ -41,7 +41,7 @@ spec:
fieldRef:
fieldPath: metadata.namespace
- name: IPERF_SERVER_LABEL_SELECTOR
value: "app.kubernetes.io/name={{ include \"iperf3-monitor.name\" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=server"
value: 'app.kubernetes.io/name={{ include "iperf3-monitor.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=server'
{{- with .Values.exporter.resources }}
resources:
{{- toYaml . | nindent 10 }}