Skip to content

Commit 0e3886b

Browse files
rameshmallaRamesh Malla
and
Ramesh Malla
authored
feat: make ConfigurationServiceOverrider accept dependent resource factory (#2175)
* feat:Made ConfigurationServiceOverrider to accept dependent resource factory Signed-off-by: Ramesh Malla <[email protected]> * Code refactor Signed-off-by: Ramesh Malla <[email protected]> * Format code Signed-off-by: Ramesh Malla <[email protected]> --------- Signed-off-by: Ramesh Malla <[email protected]> Co-authored-by: Ramesh Malla <[email protected]>
1 parent 45b1f03 commit 0e3886b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java

+14
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import io.fabric8.kubernetes.api.model.HasMetadata;
1313
import io.fabric8.kubernetes.client.KubernetesClient;
1414
import io.javaoperatorsdk.operator.api.monitoring.Metrics;
15+
import io.javaoperatorsdk.operator.api.reconciler.dependent.DependentResourceFactory;
1516

1617
@SuppressWarnings("unused")
1718
public class ConfigurationServiceOverrider {
@@ -39,6 +40,7 @@ public class ConfigurationServiceOverrider {
3940
private Set<Class<? extends HasMetadata>> defaultNonSSAResource;
4041
private Boolean previousAnnotationForDependentResources;
4142
private Boolean parseResourceVersions;
43+
private DependentResourceFactory dependentResourceFactory;
4244

4345
ConfigurationServiceOverrider(ConfigurationService original) {
4446
this.original = original;
@@ -77,6 +79,12 @@ public ConfigurationServiceOverrider withMinConcurrentWorkflowExecutorThreads(in
7779
return this;
7880
}
7981

82+
public ConfigurationServiceOverrider withDependentResourceFactory(
83+
DependentResourceFactory dependentResourceFactory) {
84+
this.dependentResourceFactory = dependentResourceFactory;
85+
return this;
86+
}
87+
8088
public ConfigurationServiceOverrider withResourceCloner(Cloner cloner) {
8189
this.cloner = cloner;
8290
return this;
@@ -184,6 +192,12 @@ public boolean checkCRDAndValidateLocalModel() {
184192
return checkCR != null ? checkCR : original.checkCRDAndValidateLocalModel();
185193
}
186194

195+
@Override
196+
public DependentResourceFactory dependentResourceFactory() {
197+
return dependentResourceFactory != null ? dependentResourceFactory
198+
: DependentResourceFactory.DEFAULT;
199+
}
200+
187201
@Override
188202
public int concurrentReconciliationThreads() {
189203
return Utils.ensureValid(

0 commit comments

Comments
 (0)