Skip to content

Fix bugs sorting service instances #239

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
merged 2 commits into from
Oct 26, 2017

Conversation

spadgett
Copy link
Member

  • Fix call to _.sortBy so that we're correctly handling secondary sort.
  • Add utility that always waits for all promises to complete (even if one has failed).

See openshift/origin-web-console#2384
See openshift/origin-web-console#2385

- Don't return null if service classes aren't passed in
- Pass an array to `_.sortBy` so that secondary sort on 'metadata.name' works
@spadgett spadgett requested a review from jwforres October 26, 2017 15:23
@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 26, 2017
}
var getServiceClassDisplayName = function(serviceInstance) {
var serviceClassName = _.get(serviceInstance, 'spec.clusterServiceClassRef.name');
return _.get(serviceClasses, [serviceClassName, 'spec', 'externalMetadata', 'displayName']) || serviceInstance.spec.clusterServiceClassExternalName;
Copy link
Member

Choose a reason for hiding this comment

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

just checking, external name is required right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure it is, but it should be OK if it's not set?

screen shot 2017-10-26 at 12 47 01 pm

Copy link
Member

Choose a reason for hiding this comment

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

yeah nevermind, forgot you were doing the secondary sort below

}

if (failed) {
deferred.reject();
Copy link
Member

Choose a reason for hiding this comment

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

i think $q.all passes up the content from the failure when it does a reject, not positive. Not that we necessarily need that, but we should document above if it is a difference.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, updated the comment.

Add a utility that always waits for all promises, even if one fails.
(`$q.all` returns immediately when one fails.)
@spadgett spadgett merged commit d89d71a into openshift:master Oct 26, 2017
@spadgett spadgett deleted the fix-sort-instances branch October 26, 2017 17:24
openshift-merge-robot added a commit to openshift/origin-web-console that referenced this pull request Oct 26, 2017
Automatic merge from submit-queue.

Wait for service classes and plans to load

Wait for all service classes and plans to load on the overview before
checking bindability and sorting service instances.

Fixes #2384

Requires openshift/origin-web-common#239

origin-web-common 0.0.70 -> 0.0.71

https://github.com/openshift/origin-web-common/releases/tag/v0.0.71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

3 participants