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 allow-container-concurrency-zero configmap property #7932

Merged
merged 3 commits into from
May 14, 2020

Conversation

julz
Copy link
Member

@julz julz commented May 13, 2020

Allows operators to prevent users setting unbounded container concurrency (i.e. containerConcurrency=0). Useful e.g. for FaaS-style environments that want to enforce - along with the existing container-concurrency-max-limit property - containerConcurrency=1 for all revisions.

Fixes #7916.

Release Note:

Adds `allow-container-concurrency-zero` property to defaults config map. Setting this to "false" prevents users setting `containerConcurrency` to 0 (i.e. unbounded concurrency).

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label May 13, 2020
@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/API API objects and controllers labels May 13, 2020
Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

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

One small nit, looks solid otherwise.

pkg/apis/config/defaults.go Outdated Show resolved Hide resolved
Copy link
Contributor

@markusthoemmes markusthoemmes left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2020
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.

/lgtm

Comment on lines +57 to +59
// DefaultAllowContainerConcurrencyZero is whether, by default,
// containerConcurrency can be set to zero (i.e. unbounded) by users.
DefaultAllowContainerConcurrencyZero bool = true
Copy link
Contributor

Choose a reason for hiding this comment

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

I am a bit torn on necessity for named constant here, but 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

Haha yeah funny you should say that, I spent five or so minutes I’m not getting back umming and ahhing on it too, but in the end it just looks so much nicer with all the constants lined up consistently in defaultConfig I think 🤷‍♂️

@vagababov
Copy link
Contributor

/assign @dprotaso @mattmoor

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.

/lgtm
/approve
/hold

Hold is for the nit, but now it's not blocked on me stamping 😉

pkg/apis/config/defaults.go Outdated Show resolved Hide resolved
@knative-prow-robot knative-prow-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 14, 2020
Co-authored-by: Matt Moore <mattmoor@vmware.com>
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label May 14, 2020
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/config/defaults.go 97.1% 97.3% 0.2
pkg/apis/serving/metadata_validation.go 98.2% 98.4% 0.1

@markusthoemmes
Copy link
Contributor

/hold cancel
/lgtm
/approve

@knative-prow-robot knative-prow-robot added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels May 14, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: julz, markusthoemmes, mattmoor

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 merged commit c1b2666 into knative:master May 14, 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/API API objects and controllers cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add setting to prevent users setting CC=0
8 participants