Skip to content

default field selectors #15864

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

Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Aug 18, 2017

We have a lot of code around field selectors that doesn't add much value. Every gettable resources probably wants name and namespace by default and since they all use metav1 (today), we can assign that as a default. If we think we'll always have metav1 style name and namespace, then this makes a reasonable default and you can always set something different.

This would fix our field selector problem for almost all resources and remove the vast majority of logic we have in the area. The selection predicates on the storage are already defaulted.

@openshift-merge-robot openshift-merge-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 18, 2017
@openshift-merge-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 18, 2017
@deads2k deads2k force-pushed the server-36-field-selector branch from b03ea68 to 00a1077 Compare August 23, 2017 15:29
@openshift-merge-robot openshift-merge-robot added 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 Aug 23, 2017
@deads2k deads2k force-pushed the server-36-field-selector branch from 00a1077 to a9cb2b2 Compare August 23, 2017 15:32
@deads2k
Copy link
Contributor Author

deads2k commented Aug 23, 2017

@liggitt @smarterclayton I mentioned and linked you both to this. Confirm you're ok with the approach and maybe @soltysh can go through and make sure I didn't remove a field selector by accident.

This is all the easy ones. The rest will take some work.

@@ -180,10 +180,5 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
return err
}

if err := scheme.AddFieldLabelConversionFunc("v1", "BuildConfig",
oapi.GetFieldLabelConversionFunc(newer.BuildConfigToSelectableFields(&newer.BuildConfig{}), map[string]string{"name": "metadata.name"}),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, found one.

@liggitt
Copy link
Contributor

liggitt commented Aug 23, 2017

default selectors for name/namespace make sense to me

@deads2k deads2k force-pushed the server-36-field-selector branch from a9cb2b2 to 86d8399 Compare August 23, 2017 15:36
@openshift-merge-robot openshift-merge-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Aug 23, 2017
@deads2k deads2k force-pushed the server-36-field-selector branch from 86d8399 to 641f267 Compare August 23, 2017 15:37
@deads2k
Copy link
Contributor Author

deads2k commented Aug 23, 2017

/retest

"github.com/openshift/origin/pkg/api/extension"
templateapi "github.com/openshift/origin/pkg/template/apis/template"
)

func addConversionFuncs(scheme *runtime.Scheme) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete this func and its use.

@enj
Copy link
Contributor

enj commented Aug 23, 2017

Minor change, LGTM once upstream is lgtm'd

@deads2k deads2k force-pushed the server-36-field-selector branch from 641f267 to 1cc7f5d Compare August 23, 2017 20:01
@openshift-ci-robot
Copy link

openshift-ci-robot commented Aug 23, 2017

@deads2k: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/extended_conformance_gce 1cc7f5d link /test extended_conformance_gce

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@smarterclayton
Copy link
Contributor

lgtm2

@openshift-merge-robot openshift-merge-robot merged commit 1cc7f5d into openshift:master Aug 24, 2017
openshift-merge-robot added a commit that referenced this pull request Aug 24, 2017
Automatic merge from submit-queue (batch tested with PRs 15870, 15888, 15788, 15907, 15936)

move more RBAC to legacy package

builds on #15864

This moves more legacy-only files that found removing unnecessary field selectors (also included here).

@openshift/sig-security
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-approved approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-api-review size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants