Repository navigation
Fix clusterresourcequota annotations validation - #10912
Conversation
|
@liggitt PTAL |
af2b241 to
b1b3d95
Compare
|
[test] |
| // further validation is left to be done server-side. | ||
| func parseAnnotationSelector(s string) (map[string]string, error) { | ||
| parsed := map[string]string{} | ||
| if len(s) == 0 { |
There was a problem hiding this comment.
zero length should return nil, not {}
|
@smarterclayton for 1.3.0? (just for the API validation change) |
| } | ||
| if clusterquota.Spec.Selector.AnnotationSelector != nil { | ||
| allErrs = append(allErrs, validation.ValidateAnnotations(clusterquota.Spec.Selector.AnnotationSelector, field.NewPath("spec", "selector", "annotations"))...) | ||
| } |
There was a problem hiding this comment.
@deads2k this seem good to you? I like the early feedback about invalid keys
|
moved to 1.3.1, will need a release note since we're tightening validation |
875f505 to
cc53467
Compare
|
@liggitt comments addressed, PTAL. |
cc53467 to
61108ad
Compare
| .nf | ||
| # Create an cluster resource quota limited to 10 pods | ||
| # Create a cluster resource quota limited to 10 pods | ||
| oc create clusterresourcequota limit\-bob \-\-project\-label\-selector=openshift.io/requester=user\-bob \-\-hard=pods=10 |
There was a problem hiding this comment.
I think the example should state project-annotation-selector considering openshift.io/requester is an annotation not label.
There was a problem hiding this comment.
Ha, good catch. Fixed.
61108ad to
8b04cbe
Compare
|
@liggitt 1.3.0 by any chance given the example was also wrong? |
|
flaked on #10928 |
liggitt
left a comment
There was a problem hiding this comment.
a couple test nits, LGTM otherwise
| errorExpected: true, | ||
| }, | ||
| { | ||
| input: "\"us=deads,liggitt,ffranz\"", |
There was a problem hiding this comment.
raw strings make it clearer whether the escaping is part of the test or not
`"us=deads,liggitt,ffranz"`
| input: "\"us=deads,liggitt,ffranz\"", | ||
| parsed: map[string]string{ | ||
| "us": "deads,liggitt,ffranz", | ||
| }, |
There was a problem hiding this comment.
add a test with multiple items that contains a value with a comma
`"a=1,2,3",b=1`
8b04cbe to
8cce1f3
Compare
|
LGTM |
8cce1f3 to
d6a9906
Compare
|
|
||
| os::test::junit::declare_suite_start "cmd/quota" | ||
|
|
||
| # Cleanup cluster resources created by this test suite |
There was a problem hiding this comment.
@stevekuznetsov PTAL? If this looks good I'll port to the release cherry-picks.
There was a problem hiding this comment.
I understand why we'd want to wait for the namespaces to get cleaned up, but I think we should not do it because:
- nowhere else do we bother
- whoever is using the tests in that manner (existing cluster, rerun suite) hasn't complained yet
- I want to kill
wait_for_command, not increase its usage.
There was a problem hiding this comment.
@stevekuznetsov There are not many places where we delete the namespace before starting the suite, one of them is the templates.sh test and we do wait_for_command there. But I agree if it goes fine without the wait we better remove it. Done. Anything else?
There was a problem hiding this comment.
No, other than that it looks fine.
d6a9906 to
a6273e2
Compare
a6273e2 to
063c94a
Compare
|
[merge] |
|
Evaluated for origin test up to 063c94a |
|
Evaluated for origin merge up to 063c94a |
|
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8988/) |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/9058/) |
Fixes #10877 (client-side part)