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: allow envoyHpa maxReplicas to be equal to minReplicas #2329

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

shahar-h
Copy link
Contributor

What this PR does / why we need it:
According to hpa spec maxReplicas cannot be less that minReplicas. The current cel validation also forbids it to be equal to minReplicas.
This PR fixes the validation to be aligned with the spec and also adds a test.

Which issue(s) this PR fixes: N/A

@shahar-h shahar-h requested a review from a team as a code owner December 20, 2023 13:12
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d13c329) 64.54% compared to head (8200ff0) 64.50%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2329      +/-   ##
==========================================
- Coverage   64.54%   64.50%   -0.04%     
==========================================
  Files         112      112              
  Lines       15949    15949              
==========================================
- Hits        10294    10288       -6     
- Misses       5007     5013       +6     
  Partials      648      648              

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

Copy link
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

I'm curious why K8s allows maxReplicas to be equal to minReplicas.

imo, EG should leave the current validation as it is: maxReplicas must bigger than minReplicas, unless we have a strong reason to change it.

@arkodg
Copy link
Contributor

arkodg commented Dec 21, 2023

I would accept this PR to handle one use case - debugging something in EG while having hpa enabled but temporarily keeping the replicas constant, this can be achieved using replicas, but requires the user to delete and readd more config rather than simply editing fields

@zhaohuabing
Copy link
Member

I would accept this PR to handle one use case - debugging something in EG while having hpa enabled but temporarily keeping the replicas constant, this can be achieved using replicas, but requires the user to delete and readd more config rather than simply editing fields

Ha, this is a legitimate use case. I guess that's also why k8s allows that.

Copy link
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@Xunzhuo Xunzhuo merged commit c4311ff into envoyproxy:main Dec 22, 2023
15 checks passed
@shahar-h shahar-h deleted the fix-maxreplicas branch December 22, 2023 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants