influxdata / influxdata/helm-charts
telegraf helm chart does not support defining constants for starlark processor in values files
- Dominant language
- Mustache
- Stars
- 257
- Forks
- 347
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
given this minimal `values.yaml` file
```
config:
aggregators:
- starlark:
source: "#"
tagpass:
my_tag: "hello"
constants:
my_constant: "hello"
```
rendering the template
```
helm repo add influxdata https://helm.influxdata.com/
helm template telegraf influxdata/telegraf --values values.yaml
```
the result includes the `telegraf` ConfigMap with the starlark aggregator
```
[[aggregators.starlark]]
source = "#"
[[aggregators.starlark.constants]]
my_constant = "hello"
[aggregators.starlark.tagpass]
my_tag = "hello"
```
that configuration won't be accepted by telegraf
```
2023-08-30T09:38:14Z E! error loading config file /etc/telegraf/telegraf.conf: error parsing starlark, line 19: (starlark.Starlark.Constants) cannot unmarshal TOML array table into map[string]interface {} (need slice)
```
the template handles `tagpass` and `tagdrop` separately here to create TOML inline tables instead of arrays of tables, so this probably needs to be extended to support starlark constants:
https://github.com/influxdata/helm-charts/blob/master/charts/telegraf/templates/_helpers.tpl#L464
Contributor guide
Assessment
This issue has not been assessed yet.