-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 project annotation selectors to cluster quota #9757
add project annotation selectors to cluster quota #9757
Conversation
// many more less active projects). These projects will contend on object creation through | ||
// this resource. | ||
Selector *unversioned.LabelSelector | ||
Selector ClusterResourceQuotaSelector |
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.
@smarterclayton We agreed in principle in person. You good with the representation?
01bf6ce
to
ea51474
Compare
[test] |
// LabelSelector is used to select projects by label. | ||
LabelSelector *unversioned.LabelSelector | ||
|
||
// AnnotationSelector is used to select projects by annotation. |
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.
Use namespaces consistently in the godoc.
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.
Use namespaces consistently in the godoc.
switched to project in the docs
Yeah it's fine. |
ea51474
to
05bdb14
Compare
@Kargakis this updates every layer to handle simple annotation selectors in addition to label selectors so we can restrict by user. |
} | ||
} | ||
|
||
annotationSelector, err := unversioned.ParseToLabelSelector(cmdutil.GetFlagString(cmd, "project-annotation-selector")) |
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.
Will an empty string create an empty selector?
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.
Will an empty string create an empty selector?
It will create one with zero MatchLabels
in it, which is treated as empty. Empty is allowed as long as the label selector is provided.
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.
Looked closer at validation. ok
Swagger spec needs update |
05bdb14
to
0af555d
Compare
lgtm |
0af555d
to
19aa546
Compare
[merge] |
[test] |
19aa546
to
3a44a24
Compare
re[test] |
3a44a24
to
3635d26
Compare
deployment flakes re[merge] re[test] |
Evaluated for origin merge up to 3635d26 |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6194/) (Image: devenv-rhel7_4580) |
deployments re[test] |
Evaluated for origin test up to 3635d26 |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/6194/) |
This adds an annotation selector (
map[string]string
) to theClusterResourceQuota
so that we can select on project requestor username:oc create clusterquota for-deads --project-annotation-selector openshift.io/requester=deads --hard secrets=10
This test will be unreliable until quota enforcement merges with #9740
@openshift/api-review The API change is breaking, but no one is using it today
@jwforres @spadgett Breaking API change to
ClusterResourceQuota.Selector
to allow the selection of projects based on annotation selectors.@Kargakis
--project-label-selector
and--project-annotation-selector
for the create?