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

Refactor sensu_check check_hooks property #956

Closed
wants to merge 6 commits into from

Conversation

treydock
Copy link
Collaborator

Pull Request Checklist

Description

Make sensu_check check_hooks property match what is actually output by sensuctl.

Related Issue

Relates to #901. Upstream documentation bug here: sensu/sensu-docs#678

Motivation and Context

The type sensu_check needs to treat check_hooks property the way it's handled by sensuctl. Previously it was just expecting an array of hooks which isn't correct as hooks associated to a check also have a type like critical or warning. This change ensures valid check_hooks are defined.

@treydock
Copy link
Collaborator Author

I will update acceptance tests to ensure that valid check_hooks are handled correctly.

@treydock
Copy link
Collaborator Author

Acceptance tests updated and passing.

@treydock
Copy link
Collaborator Author

I have local changes that are more complex but valid use of check_hooks and they are failing, this PR is not complete.

…roperty as sorting array of hashes seems to throw errors
@treydock
Copy link
Collaborator Author

Looks like can't use PuppetX::Sensu::ArrayProperty as parent for a property when elements are hashes. I'll have to check if this mistake was made else where. I verified with vagrant that the order of array elements in JSON defining a check is the order that is output when listing checks so this should work nicely without comparing should/is with a sort.

@ghoneycutt
Copy link
Collaborator

@treydock could you please rebase so this will merge

@ghoneycutt
Copy link
Collaborator

Rebased in #962

@ghoneycutt ghoneycutt closed this Aug 21, 2018
@treydock treydock deleted the sensu2-check_hooks branch August 21, 2018 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants