-
Notifications
You must be signed in to change notification settings - Fork 260
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
Add support for multiple tags via key/value #186
Conversation
Provide the ability to add tags on different attribute levels. Chef will merge the attributes together and the template will generate the list from them. To "remove" a tag on a higher precedence level, set it to an empty string.
1 similar comment
@lightpriest Getting back to this feature now. Looks like it can't be merged - there might be a conflict in the datadog.conf somewhere. Also, is there any tests you might write with ChefSpec to validate the template outcome of passing in the tags attribute? |
Mainly to avoid creating another pull-request
@miketheman I added a spec for this, imitating the structure of the other specs. I also tried to add a commit that would fix the merge conflict, but I guess it wasn't enough. The conflict is in a comment section in |
+1 for this! |
Closing, as superseded with #296 Thanks for the contribution! |
* Extract datadog tags into a template var * Support strings and hashes * Update docs for tag attribute * Add test coverage for tags (string, hash, empty hash value) Closes #186
A new pull request (previous is #183) without a version change and with a more strict test for Hash implementation.
Enables setting tags from different attribute levels, backward compatible.
Suppose you have role A which acts on two environments B and C.
This patch enables setting this on the role:
And these on the different environments:
Will result in datadog.conf having
tags: cluster:A,environment:B
andtags: cluster:A,environment:C
respectively. String version of the tags should still work. To remove a tag in a higher precedence level, set it to an empty string.This is also reported in #170.