Skip to content
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

UnrecognizedPropertyException for field observedGeneration in native mode #824

Closed
Javatar81 opened this issue Feb 7, 2024 · 2 comments · Fixed by #826
Closed

UnrecognizedPropertyException for field observedGeneration in native mode #824

Javatar81 opened this issue Feb 7, 2024 · 2 comments · Fixed by #826
Assignees

Comments

@Javatar81
Copy link

I have a class that extends ObservedGenerationAwareStatus and thus inherits the field observedGeneration. I also registered it for reflection because the CustomResources are in a project pulled into the main project via maven dependency.

@RegisterForReflection
public class GiteaRepositoryStatus extends ObservedGenerationAwareStatus {

...

}

When I run my operator as native executable, I get the following error:

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "observedGeneration" (class io.devjoy.gitea.k8s.model.GiteaStatus), not marked as ignorable (one known property: "conditions"])
61
at [Source: (BufferedInputStream); line: 1, column: 4515] (through reference chain: io.fabric8.kubernetes.api.model.DefaultKubernetesResourceList["items"]->java.util.ArrayList[0]->io.devjoy.gitea.k8s.model.Gitea["status"]->io.devjoy.gitea.k8s.model.GiteaStatus["observedGeneration"])

The CRD resource manifest is generated correctly and contains the observedGeneration field.

@metacosm metacosm self-assigned this Feb 7, 2024
@metacosm
Copy link
Member

metacosm commented Feb 8, 2024

So this should also be addressed by quarkusio/quarkus#38586 as Quarkus registers classes with their hiearchy.

metacosm added a commit that referenced this issue Feb 8, 2024
Fixes #824
Previously, we were only registering the class itself for reflection, we
now register the full hierarchy instead.

Signed-off-by: Chris Laprun <claprun@redhat.com>
@metacosm
Copy link
Member

metacosm commented Feb 8, 2024

I've opened a #826 that should address both your native issues. Let me know how it goes!

metacosm added a commit that referenced this issue Feb 8, 2024
Fixes #824
Previously, we were only registering the class itself for reflection, we
now register the full hierarchy instead.

Signed-off-by: Chris Laprun <claprun@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants