-
Notifications
You must be signed in to change notification settings - Fork 220
NullPointerException in SSABasedGenericKubernetesResourceMatcher #2032
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Relates to #2028 - it's the same NPE that happens when using a secret with stringData in the desired state. |
Hi @kosmoz , on short notice you might want to try the generic matcher, see: also: Would be great if you could provide a simple project to reproduce. Or provide the logs from here: https://github.com/shawkins/java-operator-sdk/blob/c879806ba279c2a285639344a7e34c01118c8c01/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/SSABasedGenericKubernetesResourceMatcher.java#L86-L86 thank you! |
Hi! I'm not sure if I will have time to create a minimal reprodicution repo. However the steps would be pretty straight forward:
Maybe I will have time next week, but in the meantime, here are the logs (I pruned them to the lines that I think matter for this error).
Notice how in the last line, it says Side note: This can probably happen for other resources with unsupported properties as well. I don't understand why Kubernetes keeps the managed field but discards the property… Thanks for your suggested workaround, we already removed the offending statement, since we want to support version 1.26 anyways. I just thought that the SDK could handle this edge-case more gracefully 🙂 Edit: For testing I created a cluster like this:
|
I believe that case is happening as well here: kubernetes/kubernetes#118519 (comment)
While you won't get the NPE the matching won't work for pruned fields - the match logic will see that desired state has something that is missing in the actual. |
see #2038 |
Bug Report
What did you do?
We ran into this issue when using unsupported beta features on an older Kubernetes version:
What did you expect to see?
At most, a warning should be printed.
What did you see instead? Under which circumstances?
Environment
Kubernetes cluster type:
vanilla
$ Mention java-operator-sdk version from pom.xml file
4.4.2
$ java -version
$ kubectl version
Possible Solution
Check if
actualMap
isnull
before adding to the result.Additional context
Related: glasskube/operator#267
The text was updated successfully, but these errors were encountered: