Skip to content

Commit

Permalink
fix: fix tracing configmap template to handle initial installation (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
cr7258 authored Aug 9, 2024
1 parent fec2e9d commit 564f8c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion helm/core/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ higress: {{ include "controller.name" . }}
{{- end }}

{{- define "skywalking.enabled" -}}
{{- if and .Values.tracing.enable (hasKey .Values.tracing "skywalking") .Values.tracing.skywalking.service }}
{{- if and (hasKey .Values "tracing") .Values.tracing.enable (hasKey .Values.tracing "skywalking") .Values.tracing.skywalking.service }}
true
{{- end }}
{{- end }}
7 changes: 5 additions & 2 deletions helm/core/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,12 @@ metadata:
data:
higress: |-
{{- $existingConfig := lookup "v1" "ConfigMap" .Release.Namespace "higress-config" }}
{{- $existingData := index $existingConfig.data "higress" | default "{}" | fromYaml }}
{{- $existingData := dict }}
{{- if $existingConfig }}
{{- $existingData = index $existingConfig.data "higress" | default "{}" | fromYaml }}
{{- end }}
{{- $newData := dict }}
{{- if .Values.tracing.enable }}
{{- if and (hasKey .Values "tracing") .Values.tracing.enable }}
{{- $_ := set $newData "tracing" .Values.tracing }}
{{- end }}
{{- toYaml (merge $existingData $newData) | nindent 4 }}
Expand Down

0 comments on commit 564f8c7

Please sign in to comment.