redhat-developer / intellij-kubernetes

IntelliJ Kubernetes plugin
https://plugins.jetbrains.com/plugin/15921-kubernetes-by-red-hat
Eclipse Public License 2.0
20 stars 20 forks source link

if I'm not authorized to my Kubernetes cluster, the icon used is OpenShift #741

Closed adietish closed 7 months ago

adietish commented 8 months ago

depends on https://github.com/redhat-developer/intellij-common/issues/216

Steps:

  1. ASSERT: have a kubernetes cluster that you're not authorized to
  2. EXEC: launch plugin & look at the cluster icon

Result: Even though my cluster is a kubernetes cluster, the icon that is used is the icon for OpenShift clusters

adietish commented 8 months ago

The reason for this is that the code thinks that a cluster, where talking OpenShift to it errors with unauthorized, is an OpenShift cluster. https://github.com/redhat-developer/intellij-common/blob/c9630d81fe209956bb97e7b0be7e5b72ffb09a15/src/main/java/com/redhat/devtools/intellij/common/kubernetes/ClusterHelper.java#L29-L33

try {
     return osClient.isSupported();
} catch (KubernetesClientException e) {
     return e.getCode() == HttpURLConnection.HTTP_UNAUTHORIZED;
}
adietish commented 7 months ago

This is also causing OIDC tokens not to be refreshed as reported in https://github.com/redhat-developer/intellij-kubernetes/issues/726#issuecomment-2043439106

adietish commented 7 months ago

This is fixed by https://github.com/redhat-developer/intellij-common/issues/216 Closing.