You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What did you see instead? Under which circumstances?
See the description further up.
Environment
Kubernetes cluster type:
Azure Kubernetes Service
io.javaoperatorsdk.operator-framework:3.2.0
openjdk 17.0.2 2022-01-18 LTS
Client Version: v1.24.0
Kustomize Version: v4.5.4
Server Version: v1.22.11
Possible Solution
What happens is that if it is a CustomResource we're not able to get the setSpec() method.
The reason seems to be related to reflection. If I do resource.getClass().getMethod("setSpec", Object.class)
instead of resource.getClass().getMethod("setSpec", spec.getClass()) it seems to work.
It might be a solution to check if the resource extends CustomResource and then do resource.getClass().getMethod("setSpec", Object.class)
Additional context
The text was updated successfully, but these errors were encountered:
Bug Report
What did you do?
When updating an instance of a
Custom Resource
we get an exception in the ReconcilerUtils.setSpec(HasMetadata resource, Object spec):This is only happening when we update, not on create.
This is the
desired
method from the dependent resource class. This is how I create the CRD instance.This is the CRD class.
This is the spec class.
One can see the source code here
What did you expect to see?
No exception and the resource updated.
What did you see instead? Under which circumstances?
See the description further up.
Environment
Kubernetes cluster type:
Azure Kubernetes Service
io.javaoperatorsdk.operator-framework:3.2.0
openjdk 17.0.2 2022-01-18 LTS
Possible Solution
What happens is that if it is a CustomResource we're not able to get the setSpec() method.
The reason seems to be related to reflection. If I do resource.getClass().getMethod("setSpec", Object.class)
instead of resource.getClass().getMethod("setSpec", spec.getClass()) it seems to work.
It might be a solution to check if the
resource
extendsCustomResource
and then doresource.getClass().getMethod("setSpec", Object.class)
Additional context
The text was updated successfully, but these errors were encountered: