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: add anonymize option #242

Merged

Conversation

matthisholleville
Copy link
Contributor

Closes #

πŸ“‘ Description

Add anonymize option during explain.

βœ… 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

As mentionned here #139, during the analyze --explain the data sent to the AI backend may contain sensitive information that the user wants to anonymize. A flag has been added to allow anonymization of the data before sending it to OpenAI. If an anonymized data is returned in the solution, it is de-anonymized to make the message clear for the user.

k8sgpt git:(feature/add-anonymize-option) βœ— ./k8sgpt analyze --filter HorizontalPodAutoScaler --namespace k8sgpt --explain --anonymize

Return of openAI 

The Kubernetes system is trying to scale a StatefulSet named tGLcCRcHa1Ce5Rs using the HorizontalPodAutoscaler, but it cannot find the StatefulSet. The solution is to verify that the StatefulSet name is spelled correctly and exists in the same namespace as the HorizontalPodAutoscaler.
     

0 k8sgpt/fake-hpa(fake-hpa)
- Error: HorizontalPodAutoscaler uses StatefulSet/fake-deployment as ScaleTargetRef which does not exist.
The Kubernetes system is trying to scale a StatefulSet named fake-deployment using the HorizontalPodAutoscaler, but it cannot find the StatefulSet. The solution is to verify that the StatefulSet name is spelled correctly and exists in the same namespace as the HorizontalPodAutoscaler.

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
@matthisholleville matthisholleville requested review from a team as code owners April 10, 2023 21:38
@matthisholleville matthisholleville changed the title Feature/add anonymize option feat: add anonymize option Apr 10, 2023
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
@matthisholleville matthisholleville force-pushed the feature/add-anonymize-option branch from 8c13c8f to 705d2a0 Compare April 10, 2023 21:44
README.md Show resolved Hide resolved
pkg/analyzer/hpa.go Outdated Show resolved Hide resolved
cmd/analyze/analyze.go Outdated Show resolved Hide resolved
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
@matthisholleville
Copy link
Contributor Author

I just modified the PR with all your comments @AlexsJones

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
@matthisholleville matthisholleville force-pushed the feature/add-anonymize-option branch from a010afa to b687473 Compare April 11, 2023 11:42
README.md Outdated Show resolved Hide resolved
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Copy link

@ivan-valkov ivan-valkov left a comment

Choose a reason for hiding this comment

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

I was just checking out the repo and decided to do a quick drive by review, feel free to ignore, as long as @AlexsJones is happy with the PR :)

pkg/util/util.go Outdated Show resolved Hide resolved
pkg/util/util.go Show resolved Hide resolved
@matthisholleville
Copy link
Contributor Author

Thank you for your review @ivan-valkov . PR updated πŸ™‚

@arbreezy
Copy link
Member

LGTM

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
@matthisholleville matthisholleville force-pushed the feature/add-anonymize-option branch from 2026695 to 08f2a89 Compare April 11, 2023 17:13
@AlexsJones AlexsJones merged commit fb75434 into k8sgpt-ai:main Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants