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

feat: generic webhook #149

Merged
merged 11 commits into from
Jun 15, 2023
Merged

Conversation

arbreezy
Copy link
Member

@arbreezy arbreezy commented Jun 7, 2023

Closes # #133

πŸ“‘ Description

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

β„Ή Additional Information

I have created a few Results functions in a similar fashion with k8sgpt resources, introduced two status fields for Results

  1. Lifecycle -> to show the lifecycle of a Result CR {created, updated, historical}
  2. Webhook -> to show the sink endpoint that is configured in K8sGPT CR for each Result

In regard to emitting messages I depend on the status of each Result to send its payload to the specified sink while also updating/cleaning up the status if needed

Sink is an interface that has two signatures Configure and Emit which may be useful if we want to add more sink types ( discord, etc..)

We also cleanup the statuses of Results when Sink is not defined anymore in K8sGPT CR

PS: I didn't consider a fanout solution cause I haven't seen such need to configure more than one integrations.

Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
@AnaisUrlichs
Copy link
Member

Could you please update the following page in the docs with the minimum information needed for people to

  1. know that there is a webhook option
  2. understand how to make use of it
    Link to docs:
    https://docs.k8sgpt.ai/reference/operator/overview/#customising-the-operator

pkg/sinks/slack.go Outdated Show resolved Hide resolved
Copy link
Member

@AlexsJones AlexsJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some messages inline

Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
@arbreezy arbreezy marked this pull request as ready for review June 8, 2023 16:21
@arbreezy arbreezy requested review from a team as code owners June 8, 2023 16:21
@arbreezy
Copy link
Member Author

arbreezy commented Jun 8, 2023

Slack message looks like this,
Screenshot from 2023-06-08 17-23-48

@arbreezy arbreezy marked this pull request as draft June 9, 2023 18:08
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
@arbreezy arbreezy marked this pull request as ready for review June 10, 2023 22:18
@arbreezy arbreezy requested a review from AlexsJones June 10, 2023 22:18
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
Signed-off-by: Aris Boutselis <arisboutselis08@gmail.com>
pkg/sinks/slack.go Show resolved Hide resolved
pkg/sinks/slack.go Show resolved Hide resolved
@AlexsJones AlexsJones merged commit 4880645 into k8sgpt-ai:main Jun 15, 2023
6 checks passed
@arbreezy arbreezy deleted the feat/webhook-report branch June 15, 2023 15:45
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.

None yet

3 participants