LiuTianyou commented on code in PR #2616:
URL: https://github.com/apache/hertzbeat/pull/2616#discussion_r1733184729
##########
manager/src/main/java/org/apache/hertzbeat/manager/service/impl/PluginServiceImpl.java:
##########
@@ -335,18 +428,30 @@ private List<URL> loadLibInPlugin(String pluginJarPath) {
out.flush();
}
}
+ if ((entry.getName().contains("define")) &&
(entry.getName().endsWith(".yml") || entry.getName().endsWith(".yaml"))) {
+ try (InputStream ymlInputStream =
jarFile.getInputStream(entry)) {
+ List<ParamDefine> params = yaml.loadAs(ymlInputStream,
List.class);
+ PARAMS_Define_MAP.putIfAbsent(pluginMetadataId,
params);
+ }
+ }
Review Comment:
It is necessary to add the plugin parameter configuration file content check
function to upload Plugin. In my previous test, if define.yml has an error, if
the user installs a plugin containing an incorrect configuration file, the
manager will not be able to restart.
It is still recommended to use object wrapping for parameters to improve
scalability
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]