Closed adietish closed 5 months ago
Current implementation of ClusterHelper.isOpenShift thinks that a kubernetes cluster, where the token is expired, is an OpenShift cluster.
ClusterHelper.isOpenShift
public static boolean isOpenShift(KubernetesClient client) { OpenShiftClient osClient = client.adapt(OpenShiftClient.class); try { return osClient.isSupported(); } catch (KubernetesClientException e) { return e.getCode() == HttpURLConnection.HTTP_UNAUTHORIZED; } }
An expired token causes a KubernetesClientException with error code 401 and thus erroneously returns true.
KubernetesClientException
true
This prevents OIDC tokens from being refreshed in https://github.com/redhat-developer/intellij-kubernetes/issues/726 as
Current implementation of
ClusterHelper.isOpenShift
thinks that a kubernetes cluster, where the token is expired, is an OpenShift cluster.An expired token causes a
KubernetesClientException
with error code 401 and thus erroneously returnstrue
.This prevents OIDC tokens from being refreshed in https://github.com/redhat-developer/intellij-kubernetes/issues/726 as