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

fix: use original resource kind as result.spec.kind #678

Closed

Conversation

jkleinlercher
Copy link
Contributor

Closes k8sgpt-ai/k8sgpt-operator#240

📑 Description

this is one approach to fix k8sgpt-ai/k8sgpt-operator#240 by using the original analyzed resource kind for the result.spec.kind attribute.

✅ 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

Signed-off-by: Johannes Kleinlercher <johannes@kleinlercher.at>
@jkleinlercher
Copy link
Contributor Author

jkleinlercher commented Sep 21, 2023

unfortunately with this change the prompt for ConfigAuditReport and VulnerabilityReport is again default since the Kind is used to set another prompt ...

if prompt, ok := ai.PromptMap[analysis.Kind]; ok {

Instead of referencing to the original resource (e.g. replicaset) I can again reference to the ConfigAuditReport. However, from my point of view the better approach would be to point to the original resource since this is also the case for the other analyzers and pointing to different prompts for different analyses should be set somehow different? Maybe there should be an explicit attribut "prompt" in the analyses struct which could then be set here

var currentAnalysis = common.Result{

Any ideas?

@thschue
Copy link
Contributor

thschue commented Dec 21, 2023

@AlexsJones, @matthisholleville: Is this one ok to merge?

@jkleinlercher
Copy link
Contributor Author

@thschue unfortunatly not because of #678 (comment)

@jkleinlercher
Copy link
Contributor Author

I need to create a new PR where the kind is still „ConfigAuditReport“ and the name is the name of the ConfigAuditReport

@jkleinlercher
Copy link
Contributor Author

close this one because #869 is a better approach

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.

[BUG]: Kind/Name of result not existing for k8sgpt-operator
2 participants