Skip to content

Commit 5e7909e

Browse files
committed
fix: make it clearer when CRD file isn't found
1 parent b5f982f commit 5e7909e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

operator-framework-junit5/src/main/java/io/javaoperatorsdk/operator/junit/LocallyRunOperatorExtension.java

+3
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ protected void before(ExtensionContext context) {
151151
private void applyCrd(String resourceTypeName) {
152152
String path = "/META-INF/fabric8/" + resourceTypeName + "-v1.yml";
153153
try (InputStream is = getClass().getResourceAsStream(path)) {
154+
if (is == null) {
155+
throw new IllegalStateException("Cannot find CRD at " + path);
156+
}
154157
final var crd = getKubernetesClient().load(is);
155158
crd.createOrReplace();
156159
Thread.sleep(CRD_READY_WAIT); // readiness is not applicable for CRD, just wait a little

0 commit comments

Comments
 (0)