Skip to content

Commit 112c063

Browse files
committed
fix: do not run extension on abstract controllers
Fixes #346
1 parent b3d76cb commit 112c063

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

operator-framework-quarkus-extension/deployment/src/main/java/io/javaoperatorsdk/quarkus/extension/deployment/QuarkusExtensionProcessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import io.quarkus.deployment.builditem.IndexDependencyBuildItem;
2727
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;
2828
import io.quarkus.deployment.util.JandexUtil;
29+
import java.lang.reflect.Modifier;
2930
import java.util.List;
3031
import java.util.Optional;
3132
import java.util.function.Function;
@@ -75,6 +76,7 @@ void createConfigurationServiceAndOperator(
7576

7677
final List<ControllerConfiguration> controllerConfigs =
7778
resourceControllers.stream()
79+
.filter(ci -> !Modifier.isAbstract(ci.flags()))
7880
.map(ci -> createControllerConfiguration(ci, additionalBeans, reflectionClasses, index))
7981
.collect(Collectors.toList());
8082

@@ -124,7 +126,7 @@ private ControllerConfiguration createControllerConfiguration(
124126
try {
125127
cr = crClass.getConstructor().newInstance();
126128
} catch (Exception e) {
127-
throw new IllegalArgumentException(e.getCause());
129+
throw new IllegalArgumentException("Cannot instantiate '" + crType + "' CR class", e);
128130
}
129131

130132
// retrieve CRD name from CR type

0 commit comments

Comments
 (0)