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

[Feature]: Add a field for a secret to the Sink Type #313

Closed
wants to merge 3 commits into from
Closed

[Feature]: Add a field for a secret to the Sink Type #313

wants to merge 3 commits into from

Conversation

phillipahereza
Copy link
Contributor

@phillipahereza phillipahereza commented Jan 8, 2024

Closes #309

📑 Description

This change allows developers to configure the sink with secrets.
Additionally, it allows developers to create sinks where the authentication is separate from the endpoint.

apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
  name: k8sgpt
  namespace: gpt
spec:
  ai:
    enabled: true
    backend: noopai
  sink:
    type: telegram
    webhook: https://api.telegram.org/bot
    secret:
      name: telegram-bot-token
      key: token

✅ 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

This PR breaks/affects #303

@phillipahereza phillipahereza requested review from a team as code owners January 8, 2024 17:06
…itionally, it allows developers to create sinks where the authentication is separate from the endpoint

```yaml
apiVersion: core.k8sgpt.ai/v1alpha1
kind: K8sGPT
metadata:
  name: k8sgpt
  namespace: gpt
spec:
  ai:
    enabled: true
    backend: noopai
  sink:
    type: telegram
    webhook: https://api.telegram.org/bot
    secret:
      name: telegram-bot-token
      key: token
```

Signed-off-by: Phillip Ahereza <pahereza@gmail.com>
Signed-off-by: Phillip Ahereza <pahereza@gmail.com>
@AlexsJones
Copy link
Member

Thanks for the contribution - does it get used anywhere yet?

@phillipahereza
Copy link
Contributor Author

Although it's not currently in use, I believe it would be beneficial to store the Slack webhook as a secret.

We can currently use it for Slack while maintaining backward compatibility. Check if the webhook is configured as a plaintext endpoint or a secret and utilize the appropriate one. I'm unsure whether this should be added to this PR or a separate one.

@AlexsJones
Copy link
Member

I think if you added it into this PR it would help show the usecase @phillipahereza

@phillipahereza phillipahereza closed this by deleting the head repository Jan 11, 2024
@phillipahereza
Copy link
Contributor Author

Ahhh shoot, accidentally deleted my fork 🤦. I'll open a new PR later today

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.

[Feature]: Add a field for a secret to the Sink Type
2 participants