Description
Bug Report
What did you do?
created a ServiceAccount as a dependent resource.
What did you expect to see?
The Service account being correctly reconciled
What did you see instead? Under which circumstances?
Caused by: java.lang.NoSuchMethodException: io.fabric8.kubernetes.api.model.ServiceAccount.getSpec()
at java.base/java.lang.Class.getMethod(Class.java:2277)
at io.javaoperatorsdk.operator.ReconcilerUtils.getSpec(ReconcilerUtils.java:98)
... 25 more
Possible Solution
Stack trace suggests this is the problem https://github.com/java-operator-sdk/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/kubernetes/GenericKubernetesResourceMatcher.java#L61
A kubernetes ServiceAccount does not have a spec but this generic matcher will always try to getSpec().
I expect this would fail for other resources that don't have a Spec.
I suspect I can override the matcher to get past this but the GenericKubernetesResourceMatcher shouldn't be failing like this.