sensu / sensu-go-chef

Chef Library Cookbook for Sensu Go
https://sensu.io
MIT License
11 stars 22 forks source link

Labels and annotations in sensu_agent config are rendered with undesirable prefix #51

Closed cwjohnston closed 5 years ago

cwjohnston commented 5 years ago

Chef Version

Chef Infra Client, version 15.1.36

Input

sensu_agent 'default' do
  config(
    "name": node['hostname'],
    "namespace": "default",
    "backend-url": ["wss://192.168.10.102:8081"],
    "insecure-skip-tls-verify": true,
    "subscriptions": ["haproxy"],
    "labels": {
      "app_id": "app01",
      "app_tier": "loadbalancer"
    },
    "annotations": {
      "color": "green"
    }
  )
end

Output

---
name: default-centos-7
namespace: default
backend-url:
- wss://192.168.10.102:8081
insecure-skip-tls-verify: true
subscriptions:
- haproxy
labels:
  :app_id: app01
  :app_tier: loadbalancer
annotations:
  :color: green

2019-07-03 at 2 27 PM

Impact

Labels and annotations are not configured as expected.

Expected Behavior

Label and annotation key/value pairs rendered in agent.yml should match the string literals provided in config

Actual Behavior

Label and annotation keys should be rendered in agent.yml with a colon prefixed

Steps to Reproduce your problem

  1. Update test/cookbooks/sensu_test/recipes/default.rb to match the sensu_agent resource described in "input" section above

  2. Manually run kitchen converge and observe the resulting /etc/sensu/agent.yml