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
ManagedKubernetesClient configuration policy should be REQUIRE #3700
Comments
- Prevent NPE when config does not exist
- Prevent NPE when config does not exist - Fix karaf itests
- Prevent NPE when config does not exist - Fix karaf itests
@mattrpav : I wanted to ask another question, Have you upgraded to Fabric8 Kubernetes Client 6.x version and checked whether this fix is working for you? I'm trying to prepare a reproducer for #3864 but at the moment I'm getting this exception with ManagedKubernetesClient:
I'm not sure whether I'm using |
@rohanKanojia I don't use OpenShift, so not sure how it'll behave. I'm happy to test out 6.x-- it'll be a bit later this week. I've got 3 other oss fixes in the queue. |
@mattrpav : You don't have to worry about OpenShift. I will fix that as part of #3864 My question is regarding your OSGI project setup in ManagedKubernetesClient (any rough code snippet would be super helpful). I can replicate that onto OpenShift. Could you please review my reproducer to see if's trying to reproduce correctly https://github.com/rohankanojia-forks/kubernetes-client-osgi-demo/blob/main/src/main/java/org/eclipse/jkube/quickstart/karaf/K8sBookGenerator.java#L42? |
@mattrpav : May I ask which OSGi framework are you using? I'm trying Apache Karaf. I'm trying to add ManagedKuberntesClient via
I've provided it in OSGI-INF/blueprint/camel-log.xml (not sure whether it's the right syntax) <bean id="kubernetesClient" class="io.fabric8.kubernetes.client.osgi.ManagedKubernetesClient" factory-method="activate">
<argument value="java.util.Map" />
</bean> But I keep getting NullPointerException, it doesn't look like ManagedKubernetesClient is getting initialized or activated. |
@mattrpav : polite ping, Did you manage to find time to look into this? It would be really helpful if you could provide a simple reproducer . The reproducer I prepared doesn't seem to be calling |
Describe the bug
ManagedKubernetesClient does not handle activate( ) method being called with null properties. The Configuration policy should be set to 'REQUIRE' in order to only activate when a config is present.
Fabric8 Kubernetes Client version
5.5.0
Steps to reproduce
Expected behavior
Do not try to activate a ManagedKubernetesClient without a configuration file
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.20.12
Environment
macOS
Fabric8 Kubernetes Client Logs
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: