-
Notifications
You must be signed in to change notification settings - Fork 108
Add alerting connector data source #607
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of comments, but the main one is the acceptance test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Covering more connector types in acc tests will be nice.
Co-authored-by: Toby Brain <[email protected]>
b6f4fe9
to
7c63a69
Compare
diag.Errorf("error while creating elasticstack_kibana_action_connector datasource: connector with name [%s/%s] and type [%s] not found", spaceId, connectorName, connectorType) | ||
} | ||
|
||
if len(foundConnectors) > 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder if it would have been better for this DS to output a list of matching connectors TBH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the use case that I want to use this with, I think this would cause confusion. What I'm trying to facilitate here is the ability to grab a connector by name (eg o11y-alertbot
) and use it in an alert without having to create a new connector in the module. If the DS returns >1 connector then its ambiguous what connector is actually being used, particularly if it has been created erroneously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I understand. You could still achieve that by having a check block do the assertion on a single result, whilst the DS would be more flexible for other consumers.
This PR adds a datasource that allows users to retrieve alerting connectors.