snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Potential NPE when deploying on Kubernetes / Openshift #409

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

The method below may return null, when adapt fails.

    private static OpenShiftClient toOpenshiftClient(KubernetesClient client) {
        try {
            return client.adapt(OpenShiftClient.class);
        } catch (KubernetesClientException e) {
            KubernetesClientErrorHandler.handle(e);
            return null; // will never happen
        }
    }

So, what is supposed to never happen actually does.

Expected behavior

handle() should always throw an Exception

Actual behavior

handle() only throws SSL related exception Exception

How to Reproduce?

Just create an app add the quarkus-openshift extension and run mvn -Dquarkus.kubernetes.deploy=true against an unreachable cluster.

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response


https://github.com/quarkusio/quarkus/issues/19870


$upstream:19870$