Skip to content

Commit

Permalink
chore: fix null addon.spec.helm.installValues value (#8010) (#8011)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldming authored Aug 22, 2024
1 parent 4c41c31 commit 5d907b8
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 59 deletions.
12 changes: 8 additions & 4 deletions deploy/helm/templates/_addon.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ Parameters:
{{- end -}}
{{- end -}}

{{- define "kubeblocks.addonHelmInstallOptions" }}
{{- if hasPrefix "oci://" .values.addonChartLocationBase }}
installOptions:
version: {{ .version }}
{{- end }}
{{- end }}

{{- define "kubeblocks.buildAddon" }}
{{- $addonImageRegistry := include "kubeblocks.imageRegistry" . }}
{{- $cloudProvider := (include "kubeblocks.cloudProvider" .) }}
Expand All @@ -99,10 +106,7 @@ spec:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" .name "version" .version "values" .Values) | indent 4 }}
chartsImage: {{ .Values.addonChartsImage.registry | default $addonImageRegistry }}/{{ .Values.addonChartsImage.repository }}:{{ .Values.addonChartsImage.tag | default .Chart.AppVersion }}
chartsPathInImage: {{ .Values.addonChartsImage.chartsPath }}
installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: {{ .version }}
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" ( dict "version" .version "values" .Values) | indent 4 }}
{{- if and (eq .name "pulsar") (eq $cloudProvider "huaweiCloud") }}
installValues:
setValues:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "alertmanager-webhook-adaptor" "version" "0.1.4" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 0.1.4
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "0.1.4" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "apecloud-otel-collector" "version" "0.1.2-beta.3" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 0.1.2-beta.3
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "0.1.2-beta.3" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "aws-load-balancer-controller" "version" "1.4.8" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 1.4.8
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "1.4.8" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down
6 changes: 1 addition & 5 deletions deploy/helm/templates/applications/csi-driver-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "kubeblocks-csi-driver" "version" "0.1.4" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 0.1.4
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "0.1.4" "values" .Values) | indent 4 }}

valuesMapping:
valueMap:
Expand Down
6 changes: 1 addition & 5 deletions deploy/helm/templates/applications/csi-driver-nfs-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "csi-driver-nfs" "version" "4.5.0" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 4.5.0
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "4.5.0" "values" .Values) | indent 4 }}

installValues:
{{- $cloudProvider := (include "kubeblocks.cloudProvider" .) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "csi-hostpath-driver" "version" "0.7.0" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 0.7.0
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "0.7.0" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down
6 changes: 1 addition & 5 deletions deploy/helm/templates/applications/grafana-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "grafana" "version" "6.43.5" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 6.43.5
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "6.43.5" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down
6 changes: 1 addition & 5 deletions deploy/helm/templates/applications/loki-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "loki" "version" "5.8.9" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 5.8.9
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "5.8.9" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down
6 changes: 1 addition & 5 deletions deploy/helm/templates/applications/prometheus-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "prometheus" "version" "15.16.1" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 15.16.1
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "15.16.1" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "snapshot-controller" "version" "1.7.2" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 1.7.2
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "1.7.2" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down
6 changes: 1 addition & 5 deletions deploy/helm/templates/applications/vmagent-addon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ spec:
helm:
{{- include "kubeblocks.addonChartLocationURL" ( dict "name" "victoria-metrics-agent" "version" "0.8.41" "values" .Values) | indent 4 }}
{{- include "kubeblocks.addonChartsImage" . | indent 4 }}

installOptions:
{{- if hasPrefix "oci://" .Values.addonChartLocationBase }}
version: 0.8.41
{{- end }}
{{- include "kubeblocks.addonHelmInstallOptions" (dict "version" "0.8.41" "values" .Values) | indent 4 }}

installValues:
configMapRefs:
Expand Down

0 comments on commit 5d907b8

Please sign in to comment.