-
Notifications
You must be signed in to change notification settings - Fork 55
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
Conversation
2d7d55c
to
27b56e2
Compare
return openOrCreateServerAdapter(selectedService, connection); | ||
} else if (selectedResource.getResource() instanceof IRoute) { | ||
final IRoute selectedRoute = (IRoute) selectedResource.getResource(); | ||
private IServer getOpenShiftServer(final IResourceUIModel selectedResourceModel) { |
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.
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.
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.
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.
c4291e4
to
caf1931
Compare
if (getService() == null) { | ||
return Collections.emptyList(); | ||
} | ||
return getAllRoutes(getService()); |
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.
This now returns all routes for the project. Should not they be filtered by areRelated(IRoute route, IService service) ?
d0fbe1c
to
0b8696a
Compare
@Override | ||
protected void onPageWillGetDeactivated(Direction progress, PageChangingEvent event, DataBindingContext dbc) { | ||
if (progress == Direction.FORWARDS) { | ||
System.err.println("deactivating FORWARD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); |
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.
meeeeeeh
a3178e0
to
6245f10
Compare
.filter(server -> server.getServerType() | ||
.equals(serverType) | ||
&& server.getAttribute(OpenShiftServerUtils.ATTR_SERVICE, "").equals(serviceName)) | ||
.findAny(); |
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.
you can also write something like .findFirst().orElse(null)
to retrieve the value and avoid the if/else block below.
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.
+1
@Override | ||
public List<String> env(){ | ||
ModelNode env = node.get(ENV); | ||
if(env.isDefined()) { |
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.
can env
be null
?
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.
nope, dmr will always return a node, a node with undefined value if there's no value.
@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) { |
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.
This method is not used now. Is it intended to be used?
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.
good catch, that's intendetend to get used for docker images without sha256:XXX digests
77ac5db
to
6af1801
Compare
+1 by Rob Stryker who tested it. |
No description provided.