这是indexloc提供的服务,不要输入任何密码
Skip to content

Validate default max scale is set if max scale limit is enabled #10921

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

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

julz
Copy link
Member

@julz julz commented Mar 9, 2021

If a non zero max scale limit is set and no default max scale is provided the "out of the box" situation for ksvcs is invalid (a default ksvc without annotations will fail validation). The operator should provide a reasonable - non-infinite - default for users if a limit is set.

See #10825, #10847.

Adds validation that a default max-scale is set if a max-scale-limit is specified in the autoscaler configmap (since otherwise the default max-scale, i.e. 0 = no max, would fail validation as it is above the max-scale-limit).

/assign @dprotaso @markusthoemmes

If a non zero scale limit is set and no default is provided the "out of
the box" situation for ksvcs is invalid. The operator should provide a
reasonable non-infinite default for users if a limit is set.
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Mar 9, 2021
@knative-prow-robot knative-prow-robot added area/autoscale size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 9, 2021
}

if lc.MaxScale < minMaxScale || (lc.MaxScaleLimit > 0 && lc.MaxScale > lc.MaxScaleLimit) {
return nil, fmt.Errorf("max-scale = %d, must be in [%d, max-scale-limit] range", minMaxScale, lc.MaxScale)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the args are in reverse order here.

Copy link
Member Author

Choose a reason for hiding this comment

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

heh, oops! good catch

@codecov
Copy link

codecov bot commented Mar 9, 2021

Codecov Report

Merging #10921 (aa37a77) into main (3ee7319) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #10921      +/-   ##
==========================================
- Coverage   88.04%   88.02%   -0.02%     
==========================================
  Files         188      188              
  Lines        9100     9103       +3     
==========================================
+ Hits         8012     8013       +1     
- Misses        833      834       +1     
- Partials      255      256       +1     
Impacted Files Coverage Δ
pkg/autoscaler/config/config.go 100.00% <100.00%> (ø)
pkg/autoscaler/statforwarder/leases.go 76.97% <0.00%> (-1.44%) ⬇️
pkg/http/request_log.go 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ee7319...aa37a77. Read the comment docs.

@vagababov
Copy link
Contributor

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 9, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vagababov

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

The pull request process is described here

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 9, 2021
Copy link
Contributor

@vagababov vagababov left a comment

Choose a reason for hiding this comment

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

/retest

@vagababov
Copy link
Contributor

/test pull-knative-serving-istio-stable-no-mesh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/autoscale cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants