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

fix remaining field selectors #16327

Merged
merged 2 commits into from
Sep 16, 2017

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Sep 13, 2017

Really hoping that #16305 works out. This updates all the rest for that pattern and allows us to remove a ton of boilerplate while maintaining decent unit test coverage. Still need a "you forgot to add a test" test, but that was already missing.

@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 13, 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-api-review labels Sep 13, 2017
Copy link
Member

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

A few nits, mostly lgtm.


func addFieldSelectorKeyConversions(scheme *runtime.Scheme) error {
return nil
Copy link
Member

Choose a reason for hiding this comment

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

Why this is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why this is empty?

We don't have any custom field selectors. Yet. I'm placing the skeleton here so people can more easily figure out what to do. This isn't really obvious.


if err := scheme.AddFieldLabelConversionFunc("v1", "BuildConfig", apihelpers.LegacyMetaV1FieldSelectorConversionWithName); err != nil {
func addFieldSelectorKeyConversions(scheme *runtime.Scheme) error {
if err := scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.String(), "Build", buildFieldSelectorKeyConversionFunc); err != nil {
return err
}
Copy link
Member

Choose a reason for hiding this comment

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

No BC here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No BC here?

No. BC only supports metadata, but we have the "name" -> "metadata.name" mapping for the ungroupified versions.

"user.uid":
return label, value, nil
default:
return runtime.DefaultMetaV1FieldSelectorConversion(label, value)
Copy link
Member

Choose a reason for hiding this comment

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

return apihelpers.LegacyMetaV1FieldSelectorConversionWithName(label, value)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

return apihelpers.LegacyMetaV1FieldSelectorConversionWithName(label, value)?

This one never had the "name" -> "metadata.name" mapping.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 15, 2017
@openshift-merge-robot openshift-merge-robot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-api-review labels Sep 15, 2017
Copy link
Member

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

This lgtm, but since this also contains changes from #16305 let's wait for the other to merge before applying the label.

@deads2k
Copy link
Contributor Author

deads2k commented Sep 15, 2017

/retest

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2017
}
fieldSet["spec.dockerImageRepository"] = imageStream.Spec.DockerImageRepository
fieldSet["status.dockerImageRepository"] = imageStream.Status.DockerImageRepository
Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k we now also have status.publicDockerImageRepository if that matters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k we now also have status.publicDockerImageRepository if that matters

Doesn't look like it's used as a field selector.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue (batch tested with PRs 16384, 16327, 16199, 16286, 16378)

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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants