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

[JBIDE-21830] select the matching route for the selected service #1041

Merged
merged 3 commits into from
Mar 24, 2016

Conversation

adietish
Copy link
Member

No description provided.

return openOrCreateServerAdapter(selectedService, connection);
} else if (selectedResource.getResource() instanceof IRoute) {
final IRoute selectedRoute = (IRoute) selectedResource.getResource();
private IServer getOpenShiftServer(final IResourceUIModel selectedResourceModel) {
Copy link
Contributor

Choose a reason for hiding this comment

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

IResourceUIModel selectedResourceModel is part of model that already loads different resources, can we collect data from that model without requests for resources to restclient model?
To that end, Deployment instance may be passed to the wizard instead of IService.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes that's the alternative to this. Either like done here or get the resources from deployment resource model. The 1st problem with the resource model is https://issues.jboss.org/browse/JBIDE-21326 . The other is that it's loading far too much, causing https://issues.jboss.org/browse/JBIDE-21858. I thus took this other approach using what we already loaded in this wizard page model.

@adietish adietish force-pushed the JBIDE-21830 branch 6 times, most recently from c4291e4 to caf1931 Compare March 21, 2016 16:10
if (getService() == null) {
return Collections.emptyList();
}
return getAllRoutes(getService());
Copy link
Contributor

Choose a reason for hiding this comment

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

This now returns all routes for the project. Should not they be filtered by areRelated(IRoute route, IService service) ?

@adietish adietish force-pushed the JBIDE-21830 branch 4 times, most recently from d0fbe1c to 0b8696a Compare March 23, 2016 11:12
@Override
protected void onPageWillGetDeactivated(Direction progress, PageChangingEvent event, DataBindingContext dbc) {
if (progress == Direction.FORWARDS) {
System.err.println("deactivating FORWARD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
Copy link
Member

Choose a reason for hiding this comment

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

meeeeeeh

@adietish adietish force-pushed the JBIDE-21830 branch 7 times, most recently from a3178e0 to 6245f10 Compare March 24, 2016 17:42
.filter(server -> server.getServerType()
.equals(serverType)
&& server.getAttribute(OpenShiftServerUtils.ATTR_SERVICE, "").equals(serviceName))
.findAny();
Copy link
Member

Choose a reason for hiding this comment

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

you can also write something like .findFirst().orElse(null) to retrieve the value and avoid the if/else block below.

Copy link
Member Author

Choose a reason for hiding this comment

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

+1

@Override
public List<String> env(){
ModelNode env = node.get(ENV);
if(env.isDefined()) {
Copy link
Member

Choose a reason for hiding this comment

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

can env be null?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope, dmr will always return a node, a node with undefined value if there's no value.

@xcoulon
Copy link
Member

xcoulon commented Mar 24, 2016

@adietish from what I could read, this looks good. I could not test it yet, though.

return imageStreamTag;
}

private ImportImageMetaData getImageMetaData(String imageRef, IProject project) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This method is not used now. Is it intended to be used?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, that's intendetend to get used for docker images without sha256:XXX digests

@adietish adietish force-pushed the JBIDE-21830 branch 2 times, most recently from 77ac5db to 6af1801 Compare March 24, 2016 20:33
@adietish
Copy link
Member Author

+1 by Rob Stryker who tested it.

@adietish adietish merged commit a7c0afb into jbosstools:jbosstools-4.3.x Mar 24, 2016
@adietish adietish deleted the JBIDE-21830 branch March 31, 2016 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants