Skip to content

error on env var parsing #54

@jesusch

Description

@jesusch

`

api_version: core/v2
type: Handler
metadata:
  name: influxdb
spec:
  type: pipe
  command: sensu-influxdb-handler
  env_vars:
   - INFLUXDB_BUCKET="{{ .Check.Namespace }}"
  filters:
  - has_metrics
  runtime_assets:
  - sensu/sensu-influxdb-handler

`

results in:
"msg":"event pipe handler executed","output":"2022/11/16 14:37:10 influxdb2client E! Write error: not found: bucket "{{.Check.Namespace}}" not found\nError executing sensu-influxdb-handler: error executing handler: write failed (attempts 0): not found: bucket "{{.Check.Namespace}}" not found\n"

I've tried {{.Check.Namespace}} as well as {{.Entity.Namespace}}

Also I've noticed that ENV vars are parsed wrong - even if the are strings
e.g.

INFLUXDB_BUCKET="somestring"
vs.
INFLUXDB_BUCKET=somestring

the first one preserves the quotes (which is wrong?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions