-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add support for kubectl create quota command #28351
Conversation
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. |
@@ -0,0 +1,80 @@ | |||
/* | |||
Copyright 2015 The Kubernetes Authors All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix year
Didn't do a deep review but please add support for specifying scopes as well via a flag |
@derekwaynecarr scopes are coming... only did a quick rebase and some fixes for your old review comments. |
@derekwaynecarr ptal, scopes are done. |
@maazkhan can you make the cla bot happy with a short confirmation that you are ok with the commit? |
ok to commit. |
@derekwaynecarr I usually get automatic cla:yes. It's because I rebased the first commit by @maazkhan. |
@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 { |
There was a problem hiding this comment.
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 {
...
}
There was a problem hiding this comment.
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 {
a couple nits, squash commtis, and then this looks ok to me. |
8592b40
to
4397c07
Compare
4397c07
to
199f991
Compare
@deads2k the cla label hopefully is fine with the human-approved override. I have squashed the generated files into the previous patch. |
GCE e2e build/test passed for commit 199f991. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 199f991. |
Automatic merge from submit-queue |
Let's hope we will be luckier with the next bot: #27796 |
Follow-up of #19625