Skip to content

fix: do not output warning when resolving a configuration #2892

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

metacosm
Copy link
Collaborator

@metacosm metacosm commented Aug 8, 2025

Signed-off-by: Chris Laprun [email protected]

@metacosm metacosm self-assigned this Aug 8, 2025
@metacosm metacosm requested review from csviri and xstefank August 8, 2025 15:06
Copy link
Collaborator

@xstefank xstefank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure which solution is better for this problem, but if this would go in there are a few points.

void test() {
final var service = new BaseConfigurationService();
final var config = service.getConfigurationFor(new NoDepReconciler());
System.out.println(config);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should be asserting the logged message or removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, this wasn't supposed to end up in the commit… 😅
I thought about asserting the lack of logging but this would require changing the architecture (i.e. make the logger an instance variable instead of a class one) just for the tests so decided against it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if is does not test anything, should we remove the test?

* prevent automated, on-demand creation of a reconciler's configuration, please use the
* {@link AbstractConfigurationService} implementation instead as base for your extension.
*/
@Deprecated(forRemoval = true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat strange to introduce a new usage of the method and deprecate it at the same time. How will this be handled when this method is removed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation uses the method but the documentation explains what should happen instead. It's only deprecated to avoid API breakage in case implementations use it but this method should really be removed, because, as far as I'm aware, there is no implementation that doesn't currently return true and the creation scenario should only be confined to this particular implementation (or its subclasses) anyway.

"Configuration for reconciler '{}' was not found. {}",
reconcilerKey,
reconcilersNameMessage);
if (!createIfNeeded()) {
Copy link
Collaborator

@csviri csviri Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the probelm we are solving this method evetually?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean in quarkus operator sdk

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now, the issue is preserving the possibility to log (or do something else, if needed) if the configuration doesn't exist in the abstract class, without logging when the configuration is created in BaseConfigurationService. Removing the logging and createIfNeeded methods would be API breaking changes so the goal is to have an implementation that doesn't break the existing API and doesn't log a warning when a configuration is created on-demand.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, approved

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 this pull request may close these issues.

3 participants