Skip to content

Commit 71b07e9

Browse files
committed
feat: make it clearer when the CRD file isn't found (#1503)
* feat: make it clearer when the CRD file isn't found * fix: only apply CRD when there is a CRD to apply
1 parent d30b9f7 commit 71b07e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ protected void before(ExtensionContext context) {
134134
ref.controllerConfigurationOverrider.accept(oconfig);
135135
}
136136

137-
applyCrd(config.getResourceTypeName());
137+
// only try to apply a CRD for the reconciler if it is associated to a CR
138+
if (CustomResource.class.isAssignableFrom(config.getResourceClass())) {
139+
applyCrd(config.getResourceTypeName());
140+
}
138141

139142
if (ref.reconciler instanceof KubernetesClientAware) {
140143
((KubernetesClientAware) ref.reconciler).setKubernetesClient(kubernetesClient);

0 commit comments

Comments
 (0)