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 support for kubectl create quota command #28351

Merged
merged 3 commits into from
Jul 27, 2016

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Jul 1, 2016

Follow-up of #19625

Create a resourcequota with the specified name, hard limits and optional scopes

Usage:
  kubectl create quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=bool] [flags]

Aliases:
  quota, q


Examples:
  // Create a new resourcequota named my-quota
  $ kubectl create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10

  // Create a new resourcequota named best-effort
  $ kubectl create quota best-effort --hard=pods=100 --scopes=BestEffort

@sttts sttts added release-note Denotes a PR that will be considered when it comes time to generate release notes. team/ux kind/feature Categorizes issue or PR as related to a new feature. labels Jul 1, 2016
@sttts sttts self-assigned this Jul 1, 2016
@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@k8s-github-robot k8s-github-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 1, 2016
@@ -0,0 +1,80 @@
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Fix year

@derekwaynecarr
Copy link
Member

Didn't do a deep review but please add support for specifying scopes as well via a flag

@sttts sttts changed the title Add support for kubectl create quota command WIP: Add support for kubectl create quota command Jul 4, 2016
@sttts
Copy link
Contributor Author

sttts commented Jul 4, 2016

@derekwaynecarr scopes are coming... only did a quick rebase and some fixes for your old review comments.

@sttts
Copy link
Contributor Author

sttts commented Jul 4, 2016

@derekwaynecarr ptal, scopes are done.

@sttts
Copy link
Contributor Author

sttts commented Jul 4, 2016

@maazkhan can you make the cla bot happy with a short confirmation that you are ok with the commit?

@sttts sttts changed the title WIP: Add support for kubectl create quota command Add support for kubectl create quota command Jul 4, 2016
@k8s-github-robot k8s-github-robot added kind/old-docs size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 4, 2016
@maazkhan
Copy link
Contributor

maazkhan commented Jul 5, 2016

ok to commit.

@derekwaynecarr
Copy link
Member

@eparis - what is needed so @sttts is automatically cla:yes ?

@sttts
Copy link
Contributor Author

sttts commented Jul 8, 2016

@derekwaynecarr I usually get automatic cla:yes. It's because I rebased the first commit by @maazkhan.

@sttts
Copy link
Contributor Author

sttts commented Jul 13, 2016

@derekwaynecarr scopes are done. Can you take another look?

if len(quota.Spec.Hard) != 2 {
framework.Failf("Expected two resources, got %v", quota.Spec.Hard)
}
if r, found := quota.Spec.Hard[api.ResourcePods]; !found || r.MilliValue() != 1000000*1000 {
Copy link
Member

Choose a reason for hiding this comment

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

nit: the check is cleaner to me if we just have a

if expected := resource.MustParse("100000); r, found := ...; !found || r.Cmp(expected) != 0 {
...
}

Copy link
Contributor Author

@sttts sttts Jul 26, 2016

Choose a reason for hiding this comment

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

Go only allow one simple statements. We have to write it in two lines:

r, found := quota.Spec.Hard[api.ResourcePods]
if expected := resource.MustParse("1000000"); !found || (&r).Cmp(expected) != 0 {

@derekwaynecarr
Copy link
Member

a couple nits, squash commtis, and then this looks ok to me.

@derekwaynecarr derekwaynecarr added this to the v1.4 milestone Jul 21, 2016
@sttts sttts force-pushed the sttts-kubectl-create-quota branch 2 times, most recently from 8592b40 to 4397c07 Compare July 26, 2016 11:29
@deads2k
Copy link
Contributor

deads2k commented Jul 26, 2016

@ncdc Make lawyer-bot happy?

@sttts Mind squashing in the generation. Otherwise we have a commit history where some commits are invalid and that's not much generated code.

@sttts sttts force-pushed the sttts-kubectl-create-quota branch from 4397c07 to 199f991 Compare July 26, 2016 12:15
@sttts
Copy link
Contributor Author

sttts commented Jul 26, 2016

@deads2k the cla label hopefully is fine with the human-approved override. I have squashed the generated files into the previous patch.

@deads2k deads2k added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 26, 2016
@deads2k
Copy link
Contributor

deads2k commented Jul 26, 2016

@deads2k the cla label hopefully is fine with the human-approved override. I have squashed the generated files into the previous patch.

Yeah, but I hate chasing them around. It'll be like @Kargakis all over again!

@k8s-bot
Copy link

k8s-bot commented Jul 26, 2016

GCE e2e build/test passed for commit 199f991.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jul 27, 2016

GCE e2e build/test passed for commit 199f991.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit d82e404 into kubernetes:master Jul 27, 2016
@0xmichalis
Copy link
Contributor

Let's hope we will be luckier with the next bot: #27796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants