Unverified Commit 56902b89 authored by alespour's avatar alespour Committed by GitHub

fix rendering of nested tables list (#413)

parent 1d311adb
apiVersion: v2
name: telegraf
version: 1.8.12
version: 1.8.13
appVersion: 1.21.2
deprecated: false
description: Telegraf is an agent written in Go for collecting, processing, aggregating, and writing metrics.
......
config:
inputs:
- statsd:
service_address: ":8125"
percentiles:
- 50
- 95
- 99
metric_separator: "_"
allowed_pending_messages: 10000
percentile_limit: 1000
- postgresql_extensible:
address: "host=localhost user=postgres sslmode=disable"
query:
- sqlquery: "SELECT count(*) as total_user_count FROM users"
version: 801
- sqlquery: "SELECT count(*) as total_post_count FROM posts"
version: 801
......@@ -201,6 +201,23 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{ $key }} = {{ $value }}
{{- end }}
{{- if eq $tp "[]interface {}" }}
{{- if eq (index $value 0 | typeOf) "map[string]interface {}" -}}
{{- range $b, $val := $value }}
[[inputs.{{- $input }}.{{- $key }}]]
{{- range $k, $v := $val }}
{{- $tps := typeOf $v }}
{{- if eq $tps "string" }}
{{ $k }} = {{ $v | quote }}
{{- end }}
{{- if eq $tps "float64" }}
{{ $k }} = {{ $v | int64 }}
{{- end }}
{{- if eq $tps "bool" }}
{{ $k }} = {{ $v }}
{{- end }}
{{- end }}
{{- end }}
{{- else }}
{{ $key }} = [
{{- $numOut := len $value }}
{{- $numOut := sub $numOut 1 }}
......@@ -227,6 +244,7 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- end }}
]
{{- end }}
{{- end }}
{{- end }}
{{- range $key, $value := $config -}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment