-
Notifications
You must be signed in to change notification settings - Fork 861
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
Adding port forward to OKE Pod #8014
base: master
Are you sure you want to change the base?
Conversation
.withName(name) | ||
.get(); | ||
if (deployment == null) { | ||
continue; |
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.
no log / failed (ignored) result to the caller ?
@@ -67,8 +64,8 @@ static void runWithClient(ClusterItem cluster, Consumer<KubernetesClient> consum | |||
Config config = prepareConfig(cluster.getConfig(), cluster); | |||
try (KubernetesClient client = new KubernetesClientBuilder().withConfig(config).build();) { | |||
consumer.accept(client); | |||
} catch (Exception e) { | |||
Exceptions.printStackTrace(e); | |||
} catch (Throwable t) { |
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.
No op ?
*/ | ||
public void startPortForward(PodItem podItem) { | ||
if (activePortForwards.containsKey(podItem.getName())) { | ||
NotificationUtils.showMessage("Port forwarding already active for: " + podItem.getName()); |
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.
I18N & message format, please.
List<PortForwardItem> forwardItems = new ArrayList<>(); | ||
List<PortForward> forwards = new ArrayList<>(); | ||
if (ports.isEmpty()) { | ||
NotificationUtils.showMessage("No ports found for pod: " + podItem.getName()); |
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.
I18N
Pod pod = client.pods().inNamespace(podItem.getNamespace()).withName(podItem.getName()).get(); | ||
|
||
if (pod == null) { | ||
System.out.println("Pod not found: " + podItem.getName()); |
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.
Log or NotificationUtils.showMessage ?
NotificationUtils.showMessage(Bundle.ForwardingPorts(port.toString(), podItem.getName())); | ||
} | ||
latches.put(podItem.getName(), latch); | ||
List<PortForwardItem> oldValue = activePortForwards.put(podItem.getName(), forwardItems); |
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.
The old value does not make much sense: even if old value is later restored, its latch
is lost for good.
activePortForwards.remove(podItem.getName()); | ||
firePropertyChange(podItem, forwardItems, oldValue); | ||
} catch (InterruptedException | IOException ex) { | ||
Exceptions.printStackTrace(ex); |
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.
Shouldn't this error notification be presented to the user somehow ?
@@ -188,8 +197,18 @@ private void runInCluster() { | |||
.create(); | |||
} | |||
}); | |||
} catch(Throwable t) { |
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.
Pass on ThreadDeath.
|
||
InputOutputProvider<?, ?, ?, ?> newSpiDef | ||
= Lookup.getDefault().lookup(InputOutputProvider.class); | ||
Object io = newSpiDef.getIO("test io", true, Lookup.EMPTY); |
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 seems as an unfinished implementation ?
@@ -87,5 +86,10 @@ public static ChildrenProvider.SessionAware<CompartmentItem, ClusterItem> getClu | |||
.collect(Collectors.toList()); | |||
}; | |||
} | |||
|
|||
@Override |
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.
Leftover no-op ?
d58dfb9
to
9d2e3c1
Compare
-1 to further changes here pending resolution of concerns in #7826 (comment) as it might conflict. Might have limited time for NetBeans in coming weeks, so adding a note that I'm happy for @matthiasblaesing or @mbien to remove this -1 and the do-not-merge label as and when they're happy with resolution. |
Adding port forward command to the Oracle Cloud Assets