|
30 | 30 |
|
31 | 31 | import static io.javaoperatorsdk.operator.api.config.ControllerConfiguration.CONTROLLER_NAME_AS_FIELD_MANAGER;
|
32 | 32 |
|
| 33 | +/** |
| 34 | + * A default {@link ConfigurationService} implementation, resolving {@link Reconciler}s |
| 35 | + * configuration when it has already been resolved before. If this behavior is not adequate, please |
| 36 | + * use {@link AbstractConfigurationService} instead as a base for your {@code ConfigurationService} |
| 37 | + * implementation. |
| 38 | + */ |
33 | 39 | public class BaseConfigurationService extends AbstractConfigurationService {
|
34 | 40 |
|
35 | 41 | private static final String LOGGER_NAME = "Default ConfigurationService implementation";
|
@@ -149,10 +155,12 @@ private static void configureFromAnnotatedReconciler(
|
149 | 155 |
|
150 | 156 | @Override
|
151 | 157 | protected void logMissingReconcilerWarning(String reconcilerKey, String reconcilersNameMessage) {
|
152 |
| - logger.warn( |
153 |
| - "Configuration for reconciler '{}' was not found. {}", |
154 |
| - reconcilerKey, |
155 |
| - reconcilersNameMessage); |
| 158 | + if (!createIfNeeded()) { |
| 159 | + logger.warn( |
| 160 | + "Configuration for reconciler '{}' was not found. {}", |
| 161 | + reconcilerKey, |
| 162 | + reconcilersNameMessage); |
| 163 | + } |
156 | 164 | }
|
157 | 165 |
|
158 | 166 | @SuppressWarnings("unused")
|
@@ -318,6 +326,13 @@ private <P extends HasMetadata> ResolvedControllerConfiguration<P> controllerCon
|
318 | 326 | informerConfig);
|
319 | 327 | }
|
320 | 328 |
|
| 329 | + /** |
| 330 | + * @deprecated This method was meant to allow subclasses to prevent automatic creation of the |
| 331 | + * configuration when not found. This functionality is now removed, if you want to be able to |
| 332 | + * prevent automated, on-demand creation of a reconciler's configuration, please use the |
| 333 | + * {@link AbstractConfigurationService} implementation instead as base for your extension. |
| 334 | + */ |
| 335 | + @Deprecated(forRemoval = true) |
321 | 336 | protected boolean createIfNeeded() {
|
322 | 337 | return true;
|
323 | 338 | }
|
|
0 commit comments