Skip to content

Commit b82e7d2

Browse files
committed
refactor: make AbstractConfigurationService easier to use by sub-classes
1 parent 71fcef4 commit b82e7d2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@ protected void throwExceptionOnNameCollision(
3939
@Override
4040
public <R extends CustomResource> ControllerConfiguration<R> getConfigurationFor(
4141
ResourceController<R> controller) {
42-
return configurations.get(ControllerUtils.getNameFor(controller));
42+
return configurations.get(keyFor(controller));
43+
}
44+
45+
protected String keyFor(ResourceController controller) {
46+
return ControllerUtils.getNameFor(controller);
47+
}
48+
49+
protected ControllerConfiguration getFor(String controllerName) {
50+
return configurations.get(controllerName);
4351
}
4452

4553
@Override

0 commit comments

Comments
 (0)