Closed deejonz closed 7 months ago
Hi @deejonz, sure, sorry for being late. Here it is: https://drive.google.com/file/d/190iiADA7SEmbchyXq2PihYEAc_wVy1ZC/view?usp=sharing
ps. you'd have to uninstall the other custom build with the same version first. I now have a EKS cluster with external OIDC authentication. Still, I'm not using the AWS OIDC service but keycloack running on our infrastructure. It is close, not identical. Crossing fingers it's close enough.
it looks much better now 👍 thanks.
Good morning @adietish same problem this morning with updated plugin:
and after clicking refresh:
then I've restarted intellij and I've got this:
clicked refresh, nothing happened. If I do: "get po" then it works fine.
@deejonz : I'm not sure whether somehow IntelliJ is reverting to stable build of plugin or whether it's actually a problem in KubernetesClient. Is it possible for you to run the BasicPodListTest in the reproducer project I had shared tomorrow morning when your token expires https://github.com/fabric8io/kubernetes-client/issues/5817#issuecomment-2033900546?
the plugin version is still 6.11-SNAPSHOT in the plugin folder..
@deejonz: @rohanKanojia could replicate it with the binary build while showing that the client library by itself didnt have the issue. I'm digging into it to see what is happensing here
@adietish hello, same issue this morning, so I run the unit test and it passed. After that the plugin automatically refreshed and it started to work so no need to restart intellij to make it working.
@deejonz : When you ran the test, KubernetesClient refreshed the token and persisted it in kubeconfig. Plugin picked up that updated token and started working.
Hi @deejonz, thanks for reporting this latest behaviour. I think that we found what was causing it. I have a new build for you to test if you want: https://drive.google.com/file/d/1eZge8aacPOUbh2vjU2GKCBO5uMm09bsW/view?usp=sharing
Hi @adietish sure I will test it, thanks for the update.
For my own documentation, our code was preventing the OIDC token from being refreshed:
In https://github.com/fabric8io/kubernetes-client/blob/a400d760fc966f660cd687d8d773dc1be04bbb85/kubernetes-client-api/src/main/java/io/fabric8/kubernetes/client/utils/TokenRefreshInterceptor.java#L138 a refresh of the token is only attempted if the kube config has an OIDC auth provider.
protected boolean useRemoteRefresh(Config newestConfig) {
// TODO: in a hard failure scenario, should we skip the expired check
return isAuthProviderOidc(newestConfig) && OpenIDConnectionUtils.idTokenExpired(newestConfig);
}
private static boolean isAuthProviderOidc(Config newestConfig) {
return newestConfig.getAuthProvider() != null && newestConfig.getAuthProvider().getName().equalsIgnoreCase("oidc");
}
Our code was erroneously thinking that the cluster was an OpenShift cluster. The config in the OpenShift client hides the auth provider (that exists in the Kubernetes client) and thus prevents tokens from being refreshed. Correcting https://github.com/redhat-developer/intellij-common/issues/216 therefore causes tokens to be refreshed if the kube config is configured with an OIDC auth provider.
Good, this morning it is working fine! Thanks for the fix!
@deejonz wohoo, great news. Very happy that all this work came to fruition 🕺 Thanks a lot for all the testing!
The PR for this can be reviewed and merged once we have a new release of kubernetes-client. fabric8/kubernetes-client is planning one for very soon. Once merged we'll release a 1.3 of our plugin.
fixed by #713. Closing.
I get the following stacktrace when browsing the kubernates tree in many places, I can see the pods item well BTW: