Skip to content

Commit fa23191

Browse files
committed
docs: add javadoc
Signed-off-by: Chris Laprun <claprun@redhat.com>
1 parent 6b64d94 commit fa23191

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/AbstractConfigurationService.java

+1
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ public <R extends HasMetadata> ControllerConfiguration<R> getConfigurationFor(
116116
if (configuration == null) {
117117
logMissingReconcilerWarning(key, getReconcilersNameMessage());
118118
} else {
119+
// if a reconciler is also a ConfigurableReconciler, update and replace its configuration
119120
if (reconciler instanceof ConfigurableReconciler<?> configurableReconciler) {
120121
final var overrider = ControllerConfigurationOverrider.override(configuration);
121122
configurableReconciler.updateConfigurationFrom(overrider);
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
package io.javaoperatorsdk.operator.api.config;
22

33
import io.fabric8.kubernetes.api.model.HasMetadata;
4+
import io.javaoperatorsdk.operator.api.reconciler.Reconciler;
45

6+
/**
7+
* Implement to change a {@link io.javaoperatorsdk.operator.api.reconciler.Reconciler}'s
8+
* configuration at runtime
9+
*
10+
* @param <P> the primary resource type of the reconciler
11+
* @since 5.1
12+
*/
513
public interface ConfigurableReconciler<P extends HasMetadata> {
14+
/**
15+
* Updates the reconciler's configuration by applying the modifications specified by the provided
16+
* {@link ControllerConfigurationOverrider} and then replacing the existing configuration in the
17+
* {@link ConfigurationService} for this reconciler. Note that this method will not be applied if
18+
* there is no configuration (as determined by {@link
19+
* ConfigurationService#getConfigurationFor(Reconciler)} for the reconciler.
20+
*
21+
* @param configOverrider provides the modifications to apply to the existing reconciler's
22+
* configuration
23+
*/
624
void updateConfigurationFrom(ControllerConfigurationOverrider<P> configOverrider);
725
}

0 commit comments

Comments
 (0)