-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add an Option to Bypass Exception for Invalid Kubernetes Config #37939
Comments
Is there some reason that |
What's strange is that, even after disabling the configuration, it continues to throw the same error. |
Do you have a sample application I can look at? |
Here is a sample application available at this GitHub link: https://github.com/cuichenli/quarkus-k8s-client-bug To reproduce the issue, please follow these steps:
After that, when you run
|
Oh, I see what's going here... This actually doesn't have to do with the Kubernetes Config extension per-se, but with the Kubernetes Client itself. @manusa does the Client have any way to configure it to be lenient with the configuration it finds on disk? |
I'm not sure I'm following the problem. However, I recall we did fix similar problems not long ago:
My assumption is that the ExecCredential can't be deserialized because despite the command failure we're still attempting to read it. Regarding unit testing and disabling the default Kubernetes Client behavior, a possible workaround would be to set the |
It's getting created because |
Is this something worth looking into on the Client side? |
I was already on it :) |
🥇 |
i have tested with the snapshot release build and it is working as expected. awesome! may i know when will 6.10 be released @manusa ? thanks! |
If everything works as expected, we should cut a minor release (6.10.0) before the end of the week. |
Closing as done |
Description
Context: Our application uses the Kubernetes extension, leveraging SSO for cluster authentication.
Issue: When executing unit tests locally, should the SSO session be outdated, the unit tests fail, generating the following errors:
Though the issue resolves once we log in through SSO, it poses an inconvenience as unit tests ideally should not necessitate a Kubernetes setup.
Proposal: Could we possibly introduce an option that prevents this error from being thrown during unit testing?
Additional Note: I've attempted using the '@WithKubernetesServer' annotation, and it made the unit test working as expected. But it heavily consumes memory and leads to OOM errors.
Implementation ideas
Possible Solution: We could consider modifying this line: https://github.com/quarkusio/quarkus/blob/main/extensions/kubernetes-client/runtime-internal/src/main/java/io/quarkus/kubernetes/client/runtime/KubernetesClientUtils.java#L21
In case any errors are thrown and an option such as allow-empty-config is specified, we could then resort to using:
This approach would enable us to bypass the error during unit tests when the configuration is invalid.
The text was updated successfully, but these errors were encountered: