Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check downcased annotation path #49

Merged
merged 1 commit into from
Apr 22, 2021
Merged

Conversation

jspaleta
Copy link
Contributor

Closes #48

check downcased annotation path but prefer original uncased annotation key if it exists. This fixed a corner case bug associated with annotations being downcased when defined agent config files.

See the sensu-email-handler for an example.
The email handler plugin currently documents the use camelcase annotation keys, which works fine when the annotations are added to an entity or check via sensuctl or api call. But if those strings are configured as part of the agent's config file, for agents not centrally managed, the annotation keys will be downcased before being written into the entity record.

The new logic will first check the downcased version of the annotation key defined as part of of the plugin options, but will prefer the non-case specific string if it also exists.

…it exists. This fixed a corner case bug associated with annotations being downcased when defined agent config files
@jspaleta jspaleta requested a review from echlebek April 21, 2021 00:01
@jspaleta jspaleta merged commit 1ce0ab3 into master Apr 22, 2021
@jspaleta jspaleta deleted the fix/annotation-downcase branch April 22, 2021 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support downcased annotations
2 participants