Skip to content

Replace duplicate intMax helpers with builtin max#16665

Open
jahnavigajjala-3 wants to merge 2 commits into
knative:mainfrom
jahnavigajjala-3:cleanup/replace-intmax-with-max
Open

Replace duplicate intMax helpers with builtin max#16665
jahnavigajjala-3 wants to merge 2 commits into
knative:mainfrom
jahnavigajjala-3:cleanup/replace-intmax-with-max

Conversation

@jahnavigajjala-3

Copy link
Copy Markdown

Fixes #16664

Proposed Changes

  • Replace the duplicated intMax helpers in the KPA and HPA reconcilers with Go's built-in max() function.
  • Remove the now-unused intMax helper implementations from both packages.
  • Rename the local max variable in kpa/scaler.go to maxScale to avoid shadowing the built-in max() function.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 18, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: jahnavigajjala-3 / name: jahnavigajjala3-commits (c1256e3)

@knative-prow

knative-prow Bot commented Jul 18, 2026

Copy link
Copy Markdown

Welcome @jahnavigajjala-3! It looks like this is your first PR to knative/serving 🎉

@knative-prow knative-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 18, 2026
@knative-prow

knative-prow Bot commented Jul 18, 2026

Copy link
Copy Markdown

Hi @jahnavigajjala-3. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@knative-prow

knative-prow Bot commented Jul 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jahnavigajjala-3
Once this PR has been reviewed and has the lgtm label, please assign dsimansk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@linkvt linkvt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm
/ok-to-test

min could be renamed to minScale to avoid also shadowing the builtin min but this is preexisting.

@knative-prow knative-prow Bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 18, 2026
@knative-prow knative-prow Bot added lgtm Indicates that a PR is ready to be merged. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 18, 2026
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.32%. Comparing base (dbce551) to head (c1256e3).

Files with missing lines Patch % Lines
pkg/reconciler/autoscaling/hpa/hpa.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16665      +/-   ##
==========================================
+ Coverage   80.29%   80.32%   +0.02%     
==========================================
  Files         217      217              
  Lines       13568    13560       -8     
==========================================
- Hits        10895    10892       -3     
+ Misses       2308     2303       -5     
  Partials      365      365              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@knative-prow knative-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2026
@linkvt

linkvt commented Jul 18, 2026

Copy link
Copy Markdown
Member

/lgtm

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2026
@linkvt

linkvt commented Jul 18, 2026

Copy link
Copy Markdown
Member

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate duplicate intMax helper in KPA and HPA reconcilers

2 participants