-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
default field selectors #15864
Conversation
[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 |
b03ea68
to
00a1077
Compare
00a1077
to
a9cb2b2
Compare
@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"}), |
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.
ah, found one.
default selectors for name/namespace make sense to me |
a9cb2b2
to
86d8399
Compare
86d8399
to
641f267
Compare
/retest |
"github.com/openshift/origin/pkg/api/extension" | ||
templateapi "github.com/openshift/origin/pkg/template/apis/template" | ||
) | ||
|
||
func addConversionFuncs(scheme *runtime.Scheme) error { |
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.
Delete this func and its use.
Minor change, LGTM once upstream is lgtm'd |
641f267
to
1cc7f5d
Compare
@deads2k: The following test failed, say
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. |
lgtm2 |
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
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.