Skip to content

Make @GradualRetry inherited #2091

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

Closed
BramMeerten opened this issue Oct 13, 2023 · 2 comments · Fixed by #2092
Closed

Make @GradualRetry inherited #2091

BramMeerten opened this issue Oct 13, 2023 · 2 comments · Fixed by #2092

Comments

@BramMeerten
Copy link
Contributor

BramMeerten commented Oct 13, 2023

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)..

@csviri
Copy link
Collaborator

csviri commented Oct 13, 2023

Sure, feel free to add a PR! thank you!

@BramMeerten
Copy link
Contributor Author

I just went through all the annotations in the framework to see if others might benefit from this too.
The following should be Inherited I think:

  • @GradualRetry
  • @Configured
  • @RateLimited

Will do a PR this weekend

BramMeerten pushed a commit to BramMeerten/java-operator-sdk that referenced this issue Oct 13, 2023
BramMeerten pushed a commit to BramMeerten/java-operator-sdk that referenced this issue Oct 13, 2023
BramMeerten pushed a commit to BramMeerten/java-operator-sdk that referenced this issue Oct 15, 2023
BramMeerten pushed a commit to BramMeerten/java-operator-sdk that referenced this issue Oct 15, 2023
BramMeerten added a commit to BramMeerten/java-operator-sdk that referenced this issue Oct 15, 2023
BramMeerten added a commit to BramMeerten/java-operator-sdk that referenced this issue Oct 17, 2023
csviri pushed a commit to BramMeerten/java-operator-sdk that referenced this issue Oct 17, 2023
BramMeerten added a commit to BramMeerten/java-operator-sdk that referenced this issue Oct 29, 2023
csviri added a commit that referenced this issue Nov 13, 2023
…) (#2092)

Signed-off-by: Bram Meerten <[email protected]>

Co-authored-by: Attila Mészáros <[email protected]>
csviri added a commit that referenced this issue Nov 14, 2023
…) (#2092)

Signed-off-by: Bram Meerten <[email protected]>

Co-authored-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
csviri added a commit that referenced this issue Nov 14, 2023
…) (#2092)

Signed-off-by: Bram Meerten <[email protected]>

Co-authored-by: Attila Mészáros <[email protected]>
csviri added a commit that referenced this issue Nov 20, 2023
…) (#2092)

Signed-off-by: Bram Meerten <[email protected]>

Co-authored-by: Attila Mészáros <[email protected]>
csviri added a commit that referenced this issue Nov 20, 2023
…) (#2092)

Signed-off-by: Bram Meerten <[email protected]>

Co-authored-by: Attila Mészáros <[email protected]>
Signed-off-by: Attila Mészáros <[email protected]>
@csviri csviri closed this as completed Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants