Skip to content

Make @GradualRetry inherited #2091

Closed
@BramMeerten

Description

@BramMeerten

When a reconciler has the @GradualRetry annotation on a superclass, it will not be used:
https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/BaseConfigurationService.java#L280

final Class<? extends Annotation> configurationClass = (Class<? extends Annotation>) Utils.getFirstTypeArgumentFromSuperClassOrInterface(instance.getClass(), AnnotationConfigurable.class);
final var configAnnotation = reconciler.getClass().getAnnotation(configurationClass);

Solution is to add @inherited to @GradualRetry

I'd be willing to contribute this change if this is an acceptable enhancement. I did a similar change in the past: #1347

Reason why this is needed in my case
I'm using micronaut framework. And when I inject my reconciler, I actually inject a proxy class that is a subclass of my Reconciler implementation (because I'm using micronaut AOP)..

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions