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

ApplyMojo.java: Either re-interrupt this method or rethrow the "InterruptedException" that can be caught here. #971

Closed
1 task
manusa opened this issue Oct 5, 2021 · 2 comments · Fixed by #974
Assignees
Labels
first-timers-only Is this your first time contributing? This could be a good place to start! good first issue Good for newcomers Hacktoberfest Issues accountable for the Hacktoberfest

Comments

@manusa
Copy link
Member

manusa commented Oct 5, 2021

Description

The following statement is reported as a Bug by SonarCloud:

https://github.com/eclipse/jkube/blob/af40c8f27af57f9651f8ebb1634df33eaf909f6a/kubernetes-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/ApplyMojo.java#L194-L196

  • should be changed to:
        } catch(InterruptedException ex) {
            Thread.currentThread().interrupt();
        } catch (Exception e) {
            throw new MojoExecutionException(e.getMessage(), e);
        }

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.

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)

@manusa manusa added good first issue Good for newcomers first-timers-only Is this your first time contributing? This could be a good place to start! Hacktoberfest Issues accountable for the Hacktoberfest labels Oct 5, 2021
@prathamgandhi
Copy link
Contributor

I'd like to do this

@prathamgandhi
Copy link
Contributor

@manusa could you take a look why the fix didn't work. I submitted the PR without testing with kubernetes, because when I ran it, my laptop started freezing and all the RAM got used up. I thought since I had just added a catch statement, there should be no error, but apparently I was wrong :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-timers-only Is this your first time contributing? This could be a good place to start! good first issue Good for newcomers Hacktoberfest Issues accountable for the Hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants