jkube: PortForwardTask.java: Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here.
Description
The following statement is reported as a Bug by SonarCloud:
- should be changed to:
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
} catch (Exception exception) {
logger.warn("Not able to port forward: %s", exception.getMessage());
} finally {
How to manually test my changes
Kubernetes
If you don’t have a real Kubernetes cluster available (most probably), you can use Minikube or Kind to test with a local cluster.
- Minikube get started guide
- Kind (Requires Docker) quick start
OpenShift
If you don’t have a real OpenShift cluster available (most probably), you can use Red Hat’s developer Sandbox for Red Hat OpenShift. The only requirement is to have a Red Hat account.
Once you have your Sandbox environment, you’ll need to download the oc tool from the cluster console.
(Press the ? icon and from the context menu select Command line tools, you’ll be redirected to https://$subdomain.openshiftapps.com/command-lines-tools where you’ll be able to download the CLI for your platform)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 18 (16 by maintainers)
@manusa , Can I contribute on this? I don’t know the manually testing part though but I know Java Exception Handling.
Hello @manusa
Sorry for the delay. As per the description, I made the changes for exception handling. The only issue that I encountered was related to testing part.
I use Windows and thus, I use Docker Desktop with WSL2 enabled. So through Windows Terminal, I first checked for the installation of all the required software such as Docker, Minikube, Kubernetes, Kubectl and found them to be installed properly. Then I proceeded with the commands (in Windows Terminal) that you have shown in example in the comment as follows:
I am unable to understand the cause of the error as I have already enabled Kubernetes and upon checking the version for Kubernetes, terminal displays it. Also, I got this same error while executing mvn -Djkube .version… line when I hadn’t installed Kubernetes earlier but it got resolved after installing and enabling Kubernetes.
I have attached the entire terminal session here for your reference. Windows_Terminal_Session.txt