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

Adding port forward to OKE Pod #8014

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jhorvath
Copy link
Contributor

@jhorvath jhorvath commented Dec 3, 2024

Adding port forward command to the Oracle Cloud Assets

@jhorvath jhorvath added LSP [ci] enable Language Server Protocol tests VSCode Extension [ci] enable VSCode Extension tests enterprise [ci] enable enterprise job labels Dec 3, 2024
@jhorvath jhorvath added this to the NB25 milestone Dec 3, 2024
@jhorvath jhorvath requested a review from sdedic December 3, 2024 14:05
@jhorvath jhorvath self-assigned this Dec 3, 2024
.withName(name)
.get();
if (deployment == null) {
continue;
Copy link
Member

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) {
Copy link
Member

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());
Copy link
Member

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());
Copy link
Member

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());
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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) {
Copy link
Member

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);
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Leftover no-op ?

@neilcsmith-net
Copy link
Member

neilcsmith-net commented Dec 11, 2024

-1 to further changes here pending resolution of concerns in #7826 (comment) as it might conflict.

cc/ @matthiasblaesing

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.

@neilcsmith-net neilcsmith-net added the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Don't merge this PR, it is not ready or just demonstration purposes. enterprise [ci] enable enterprise job LSP [ci] enable Language Server Protocol tests VSCode Extension [ci] enable VSCode Extension tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants