Skip to content

Commit 682ceb7

Browse files
committed
feat: check that CR class is properly annotated
1 parent e104e58 commit 682ceb7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,13 @@ private ControllerConfiguration createControllerConfiguration(
120120
// load CR class
121121
final Class<CustomResource> crClass = (Class<CustomResource>) loadClass(crType);
122122

123-
// register CR class for introspection
124-
reflectionClasses.produce(new ReflectiveClassBuildItem(true, true, crClass));
123+
// Instantiate CR to check that it's properly annotated
124+
final CustomResource cr;
125+
try {
126+
cr = crClass.getConstructor().newInstance();
127+
} catch (Exception e) {
128+
throw new IllegalArgumentException(e.getCause());
129+
}
125130

126131
// retrieve CRD name from CR type
127132
final var crdName = CustomResource.getCRDName(crClass);

0 commit comments

Comments
 (0)