Hi,
I’m a beginner in Go and am struggling with the different types. This is for a Helm template.
In my values.yaml file I have this structure for my variables:
receivers:
opencensus:
port: 55678
zipkin:
port: 9411
jaeger:
jaeger-thrift-tchannel-port: 14267
jaeger-thrift-http-port: 14268
exporters:
stackdriver:
project: "vigilant-sol-256207"
enable_tracing: true
My end result needs to be this:
data:
oc-collector-config: |
receivers:
opencensus:
port: 55678
zipkin:
port: 9411
jaeger:
jaeger-thrift-tchannel-port: 14267
jaeger-thrift-http-port: 14268
exporters:
stackdriver:
project: "vigilant-sol-256207"
enable_tracing: true
This is about the closest I got:
oc-collector-config: |
receivers:
{{- range $i, $receivers := .Values.receivers }}
{{ $receivers | indent 6 }}
{{ end }}
exporters:
{{- range $i, $exporters := .Values.exporters }}
{{ $exporters | indent 6 }}
{{ end }}
but it throws me the following error:
at <6>: wrong type for value; expected string; got map[string]interface {}
Can someone please explain me what I’m doing wrong here? I’ve been struggling with it for hours now.
Any help is greatly appreciated.
Kind regards,
Eric V.