Add sensu_resources type that will handle resource purging #1158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Description
Add
sensu_resources
type that behaves just like Puppet's built-inresources
type that will handle purging unmanaged sensu types.Related Issue
Fixes #1157
Motivation and Context
The resources collected for sensuctl types take the name of
$name in $namespace
to support resources with the same name in different name spaces. However it's not required to name resources that way and this causes issues with the Puppet built-inresources
type which just looks at the name and nothing else. This new type looks atname
plusnamespace
to determine if a resource exists in the catalog. The prefetching in providers that links catalog items to sensuctl items is already matching on name + namespace.How Has This Been Tested?
I added acceptance tests for a type that supports namespaces and for a type that does not support namespaces to show the new
sensu_resources
type will work for both.