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: reverse hpa ScalingLimited error condition #1366

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antoinedeschenes
Copy link

Closes #

📑 Description

k8sgpt currently outputs - Error: the desired count is within the acceptable range when an HPA is working properly. This is due to the "ScalingLimited" condition to be reversed:

      message: the desired count is within the acceptable range
      reason: DesiredWithinRange
      status: "False"
      type: ScalingLimited

This also fixes a typo in the analyzer's name not matching the kind, although that could be removed for another time.

✅ 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: Antoine Deschênes <antoine.deschenes@linux.com>
@antoinedeschenes antoinedeschenes requested review from a team as code owners January 31, 2025 20:06
@@ -46,7 +46,7 @@ var coreAnalyzerMap = map[string]common.IAnalyzer{
}

var additionalAnalyzerMap = map[string]common.IAnalyzer{
"HorizontalPodAutoScaler": HpaAnalyzer{},
"HorizontalPodAutoscaler": HpaAnalyzer{},
Copy link
Author

Choose a reason for hiding this comment

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

This would break k8sgpt filters add, maybe I should remove it?

Copy link
Member

Choose a reason for hiding this comment

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

Are you saying because this is using v2 api it would break on default?

Copy link
Author

Choose a reason for hiding this comment

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

I’m sorry, this wasn't clear. I mean that renaming the filter won’t align with the active_filters value used in an existing k8sgpt.yaml config file. This might need a config migration.

@antoinedeschenes
Copy link
Author

@AlexsJones

Should there also be a specific case for kubernetes/kubernetes#116387

Copy link
Member

@AlexsJones AlexsJones left a comment

Choose a reason for hiding this comment

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

Need to figure out if this needs us to update the config

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.23%. Comparing base (173e4dc) to head (03adcfc).
Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1366      +/-   ##
==========================================
- Coverage   34.76%   34.23%   -0.54%     
==========================================
  Files          94       97       +3     
  Lines        6342     6511     +169     
==========================================
+ Hits         2205     2229      +24     
- Misses       4046     4189     +143     
- Partials       91       93       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Proposed
Development

Successfully merging this pull request may close these issues.

2 participants