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

question: Toggling between language has a bug #294

Closed
2 of 3 tasks
donwany opened this issue Apr 17, 2023 · 3 comments · Fixed by #296
Closed
2 of 3 tasks

question: Toggling between language has a bug #294

donwany opened this issue Apr 17, 2023 · 3 comments · Fixed by #296
Assignees
Labels
bug Something isn't working

Comments

@donwany
Copy link

donwany commented Apr 17, 2023

Checklist:

  • I've searched for similar issues and couldn't find anything matching
  • I've included steps to reproduce the bug.
  • I've included the version of Kubernetes and k8sgpt.

Subject of the issue

Toggling between languages is not working.

k8sgpt analyze --explain -o json --language "english" --filter=Pod | jq .
k8sgpt analyze --explain -o json --language "french" --filter=Pod | jq .

Your environment

LOCAL HOST USING MINIKUBE CLUSTER

  • Version of Kubernetes minikube v1.29.0
  • Host OS and its version / If windows, is it WSL?
    macOS
  • Version of k8sgpt VERSION: 0.2.1

Steps to reproduce

  • Step 1
  • Step 2

Expected behaviour

Toggle between different languages easily

Actual behaviour

Same language is maintained despite changing the language parameter.

Additional context / screenshots

Screenshot 2023-04-17 at 1 56 48 PM

Screenshot 2023-04-17 at 1 57 21 PM

@matthisholleville
Copy link
Contributor

Hello,

Thank you for your feedback. Indeed, I believe it's related to the fact that we are querying the cache in this case.

Could you try relaunching your two commands with the addition of "--no-cache" flag?

I think we could fix this by storing the language of the cached data and forcing "no-cache" mode if the language differs from the last call.

@matthisholleville
Copy link
Contributor

I tried and I confirm this is a caching issue :

(matthisholleville) ➜  k8sgpt git:(main) ./k8sgpt analyze --namespace k8sgpt --language "french" --explain --no-cache
 100% |████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (1/1, 8 it/min)        

0 k8sgpt/fake-hpa(fake-hpa)
- Error: HorizontalPodAutoscaler uses StatefulSet/fake-deployment as ScaleTargetRef which does not exist.
Message d'erreur Kubernetes simplifié : L'HorizontalPodAutoscaler utilise StatefulSet/fake-deployment comme référence de mise à l'échelle, mais celle-ci n'existe pas.

Solution : Vérifiez que la référence de mise à l'échelle correspond à un objet existant dans le cluster Kubernetes. S'il s'agit d'une erreur de syntaxe, corrigez-la. Si l'objet de référence a été supprimé, créez-en un nouveau et mettez à jour la référence de mise à l'échelle.

(matthisholleville) ➜  k8sgpt git:(main) ./k8sgpt analyze --namespace k8sgpt --language "english" --explain --no-cache
 100% |███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (1/1, 12 it/min)        

0 k8sgpt/fake-hpa(fake-hpa)
- Error: HorizontalPodAutoscaler uses StatefulSet/fake-deployment as ScaleTargetRef which does not exist.
The Kubernetes error message is saying that the HorizontalPodAutoscaler is set to use a StatefulSet or fake deployment called "fake-deployment" as its target for scaling, but that target doesn't exist.

To solve this error, you can either create the StatefulSet or deployment with the appropriate name, or update the HorizontalPodAutoscaler to use the correct target.

(matthisholleville) ➜  k8sgpt git:(main) ./k8sgpt analyze --namespace k8sgpt --language "french" --explain     
 100% |█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (1/1, 95 it/s)        

0 k8sgpt/fake-hpa(fake-hpa)
- Error: HorizontalPodAutoscaler uses StatefulSet/fake-deployment as ScaleTargetRef which does not exist.
The Kubernetes error message is saying that the HorizontalPodAutoscaler is set to use a StatefulSet or fake deployment called "fake-deployment" as its target for scaling, but that target doesn't exist.

To solve this error, you can either create the StatefulSet or deployment with the appropriate name, or update the HorizontalPodAutoscaler to use the correct target.

@matthisholleville matthisholleville added the bug Something isn't working label Apr 18, 2023
@matthisholleville matthisholleville self-assigned this Apr 18, 2023
matthisholleville added a commit to matthisholleville/k8sgpt that referenced this issue Apr 18, 2023
Signed-off-by: Matthis <matthish29@gmail.com>
arbreezy pushed a commit that referenced this issue Apr 18, 2023
@donwany
Copy link
Author

donwany commented Apr 19, 2023

This solution worked. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants