You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/09/03 04:45:08 UTC

[skywalking] branch master updated: add suffix limit to avoid possible start problems (#7641)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new e5a5e05  add suffix limit to avoid possible start problems (#7641)
e5a5e05 is described below

commit e5a5e05f997ef184b165434dcb43edbc5350b66a
Author: honganan <97...@qq.com>
AuthorDate: Fri Sep 3 12:44:55 2021 +0800

    add suffix limit to avoid possible start problems (#7641)
---
 CHANGES.md                                                             | 1 +
 docs/en/ui/README.md                                                   | 2 +-
 .../java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java | 3 +++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/CHANGES.md b/CHANGES.md
index c8dfcf6..3871d9d 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -52,6 +52,7 @@ Release Notes.
 * Support nacos grouped dynamic configurations.
 * Support for filter function filtering of int type values.
 * Support mTLS for gRPC channel.
+* Add yaml file suffix limit when reading ui templates.
 
 #### UI
 
diff --git a/docs/en/ui/README.md b/docs/en/ui/README.md
index 843443f..d677de3 100644
--- a/docs/en/ui/README.md
+++ b/docs/en/ui/README.md
@@ -37,7 +37,7 @@ User could click the `lock` button left aside the `Service/Instance/Endpoint Rel
 Users could customize the dashboard. The default dashboards are provided through the default templates located in 
 `/ui-initialized-templates` folders.
 
-The template file follows this format.
+The template file must end with `.yml` or `.yaml` and follows this format.
 ```yaml
 templates:
   - name: template name # The unique name
diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
index bfb5443..edd7084 100755
--- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
+++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/CoreModuleProvider.java
@@ -376,6 +376,9 @@ public class CoreModuleProvider extends ModuleProvider {
         try {
             final File[] templateFiles = ResourceUtils.getPathFiles("ui-initialized-templates");
             for (final File templateFile : templateFiles) {
+                if (!templateFile.getName().endsWith(".yml") && !templateFile.getName().endsWith(".yaml")) {
+                    continue;
+                }
                 new UITemplateInitializer(new FileInputStream(templateFile))
                     .read()
                     .forEach(uiTemplate -> {