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

Add new ConfigMap fields for service initial scale #7674

Merged

Conversation

taragu
Copy link
Contributor

@taragu taragu commented Apr 22, 2020

Adding two new ConfigMap fields allow-zero-initial-scale and default-initial-scale to config-autoscaler.

/lint

Part 1 of #7682

Release Note

NONE

Adding two new ConfigMap fields `allow-zero-initial-scale` and `default-initial-scale` to config-autoscaler.
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 22, 2020
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 22, 2020
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@taragu: 0 warnings.

In response to this:

Adding two new ConfigMap fields allow-zero-initial-scale and default-initial-scale to config-autoscaler.

/lint

Part 1 of #4098

Release Note

NONE

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/test-infra repository.

@taragu
Copy link
Contributor Author

taragu commented Apr 22, 2020

/assign @dprotaso @markusthoemmes @vagababov

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.

Mostly nits.

pkg/autoscaler/config/config.go Outdated Show resolved Hide resolved
pkg/autoscaler/config/config_test.go Outdated Show resolved Hide resolved
pkg/autoscaler/config/config_test.go Outdated Show resolved Hide resolved
pkg/autoscaler/config/config_test.go Show resolved Hide resolved
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

Produced via:
gofmt -s -w $(find -path './vendor' -prune -o -path './third_party' -prune -o -type f -name '*.go' -print)

pkg/autoscaler/config/config_test.go Outdated Show resolved Hide resolved
@julz
Copy link
Member

julz commented Apr 23, 2020

should we add the new fields to the _example: block in autoscaler.yaml here?

@markusthoemmes
Copy link
Contributor

@julz I think we should hold off from an _example entry until the feature is implemented.

@taragu
Copy link
Contributor Author

taragu commented Apr 23, 2020

/retest

@dprotaso
Copy link
Member

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2020
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2020
Comment on lines 281 to 286
if lc.InitialScale < 0 {
return nil, fmt.Errorf("initial-scale = %v, must be at least 0 (or at least 1 when allow-zero-initial-scale is false)", lc.InitialScale)
}
if lc.InitialScale == 0 && !lc.AllowZeroInitialScale {
return nil, fmt.Errorf("initial-scale = %v, must be at least 1 since allow-zero-initial-scale is false", lc.InitialScale)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If we re-arrange in the reverse order, then we can go back to the previous errors messages, since they'd be correct, I think. But probably isn't important much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I understand. What do you mean by "we can go back to the previous errors messages"?

Copy link
Contributor

@vagababov vagababov Apr 23, 2020

Choose a reason for hiding this comment

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

eh, basically

if x < 0 || x==0 && !allow {
  return "must be non-negative or positive if allow is unset"
}

Copy link
Member

Choose a reason for hiding this comment

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

How about:

minInitialScale := 1
if lc.AllowZeroInitialScale {
  minInitialScale = 0
}
if lc.InitialScale < minInitialScale {
  return nil, fmt.Errorf("initial-scale = %d, must be at least %d", lc.InitialScale, minInitialScale)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Well we kind of had that before :-)
It's bikeshedding at this point. I like mine, since it has single if :)

@taragu
Copy link
Contributor Author

taragu commented Apr 24, 2020

/test pull-knative-serving-integration-tests

Copy link
Member

@dprotaso dprotaso left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 24, 2020
@duglin
Copy link

duglin commented Apr 24, 2020

/lgtm

@taragu
Copy link
Contributor Author

taragu commented Apr 24, 2020

/retest

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
/lgtm
/approve

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso, taragu, 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 Apr 24, 2020
@taragu
Copy link
Contributor Author

taragu commented Apr 24, 2020

/retest

1 similar comment
@taragu
Copy link
Contributor Author

taragu commented Apr 24, 2020

/retest

@knative-test-reporter-robot

The following jobs failed:

Test name Triggers Retries
pull-knative-serving-integration-tests pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
pull-knative-serving-integration-tests
3/3

Job pull-knative-serving-integration-tests expended all 3 retries without success.

@knative-prow-robot knative-prow-robot merged commit df15f7f into knative:master Apr 24, 2020
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/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.

10 participants