k8sgpt
k8sgpt copied to clipboard
fix: use original resource kind as result.spec.kind
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
unfortunately with this change the prompt for ConfigAuditReport and VulnerabilityReport is again default since the Kind is used to set another prompt ... https://github.com/k8sgpt-ai/k8sgpt/blob/1da4b7c8f0eee877d5b76a7dd9abda7631d922f3/pkg/analysis/analysis.go#L266
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 https://github.com/k8sgpt-ai/k8sgpt/blob/1da4b7c8f0eee877d5b76a7dd9abda7631d922f3/pkg/integration/trivy/analyzer.go#L77
Any ideas?
@AlexsJones, @matthisholleville: Is this one ok to merge?
@thschue unfortunatly not because of https://github.com/k8sgpt-ai/k8sgpt/pull/678#issuecomment-1729566846
I need to create a new PR where the kind is still „ConfigAuditReport“ and the name is the name of the ConfigAuditReport
close this one because https://github.com/k8sgpt-ai/k8sgpt/pull/869 is a better approach