Skip to content

Commit 0948895

Browse files
author
Soroosh Sarabadani
committed
fix resource loading in environments with hierarchical classpath
1 parent 465430f commit 0948895

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

operator-framework/src/main/java/io/javaoperatorsdk/operator/ControllerToCustomResourceMappingsProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class ControllerToCustomResourceMappingsProvider {
2020
static Map<Class<? extends ResourceController>, Class<? extends CustomResource>> provide(final String resourcePath) {
2121
Map<Class<? extends ResourceController>, Class<? extends CustomResource>> controllerToCustomResourceMappings = new HashMap();
2222
try {
23-
final Enumeration<URL> customResourcesMetadataList = ControllerUtils.class.getClassLoader().getResources(resourcePath);
23+
final var classLoader = Thread.currentThread().getContextClassLoader();
24+
final Enumeration<URL> customResourcesMetadataList = classLoader.getResources(resourcePath);
2425
for (Iterator<URL> it = customResourcesMetadataList.asIterator(); it.hasNext(); ) {
2526
URL url = it.next();
2627

0 commit comments

Comments
 (0)