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

quota: make namespaces and labelselector optional and nullable #267

Merged
merged 1 commit into from
Mar 28, 2019

Conversation

mfojtik
Copy link
Contributor

@mfojtik mfojtik commented Mar 28, 2019

Prevent this error:

❯ oc create clusterquota for-user-3 \                                                                                                                                                                                                                                                                                                                                    ✘
     --project-annotation-selector openshift.io/requester=foo \
     --hard pods=10 \
     --hard secrets=20
The ClusterResourceQuota "for-user-3" is invalid: []: Invalid value: map[string]interface {}{"kind":"ClusterResourceQuota", "apiVersion":"quota.openshift.io/v1", "metadata":map[string]interface {}{"uid":"1a4f3b42-5152-11e9-a8b1-0e719a5075b6", "name":"for-user-3", "creationTimestamp":"2019-03-28T12:07:48Z", "generation":1}, "spec":map[string]interface {}{"selector":map[string]interface {}{"annotations":map[string]interface {}{"openshift.io/requester":"foo"}, "labels":interface {}(nil)}, "quota":map[string]interface {}{"hard":map[string]interface {}{"pods":"10", "secrets":"20"}}}, "status":map[string]interface {}{"total":map[string]interface {}{}, "namespaces":interface {}(nil)}}: validation failure list:
spec.selector.labels in body must be of type object: "null"
status.namespaces in body must be of type array: "null"

@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Mar 28, 2019
@mfojtik
Copy link
Contributor Author

mfojtik commented Mar 28, 2019

/retest

1 similar comment
@mfojtik
Copy link
Contributor Author

mfojtik commented Mar 28, 2019

/retest

Copy link

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

\

@@ -40,9 +40,13 @@ type ClusterResourceQuotaSpec struct {
// the project must match both restrictions.
type ClusterResourceQuotaSelector struct {
// LabelSelector is used to select projects by label.
// +optional
// +nullable
Copy link

Choose a reason for hiding this comment

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

Drop the nullable optional should be sufficient from what I've looked.

Copy link

Choose a reason for hiding this comment

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

Based on what @damemi told me optional is only informational and nullable is the one we want.

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 28, 2019
@soltysh soltysh removed approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. labels Mar 28, 2019
Copy link

@soltysh soltysh 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

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 28, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mfojtik, soltysh

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 28, 2019
@mfojtik
Copy link
Contributor Author

mfojtik commented Mar 28, 2019

/refresh

@openshift-merge-robot openshift-merge-robot merged commit 6a2df10 into openshift:master Mar 28, 2019
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. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants