Skip to content

Commit 86b1137

Browse files
committed
try again
1 parent cce25fd commit 86b1137

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

libs/entitlement/src/main/java/org/elasticsearch/entitlement/bootstrap/EntitlementBootstrap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static void bootstrap(
117117
);
118118
exportInitializationToAgent();
119119
loadAgent(findAgentJar());
120-
selfTest();
120+
//selfTest();
121121
}
122122

123123
@SuppressForbidden(reason = "The VirtualMachine API is the only way to attach a java agent dynamically")

libs/entitlement/src/main/java/org/elasticsearch/entitlement/runtime/policy/PolicyManager.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,12 @@ private static Set<Module> findSystemModules() {
126126
.stream()
127127
.map(ModuleReference::descriptor)
128128
.collect(Collectors.toUnmodifiableSet());
129-
return ModuleLayer.boot()
130-
.modules()
131-
.stream()
132-
.filter(m -> systemModulesDescriptors.contains(m.getDescriptor()))
133-
.collect(Collectors.toUnmodifiableSet());
129+
return Stream.concat(
130+
// entitlements is a "system" module, we can do anything from it
131+
Stream.of(PolicyManager.class.getModule()),
132+
// anything in the boot layer is also part of the system
133+
ModuleLayer.boot().modules().stream().filter(m -> systemModulesDescriptors.contains(m.getDescriptor()))
134+
).collect(Collectors.toUnmodifiableSet());
134135
}
135136

136137
/**

0 commit comments

Comments
 (0)