You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/03/15 04:00:44 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #4514: Add selector property in application.yml

wu-sheng commented on a change in pull request #4514: Add selector property in application.yml
URL: https://github.com/apache/skywalking/pull/4514#discussion_r392639250
 
 

 ##########
 File path: oap-server/server-bootstrap/src/main/java/org/apache/skywalking/oap/server/starter/config/ApplicationConfigLoader.java
 ##########
 @@ -105,6 +107,19 @@ private void overrideConfigBySystemEnv(ApplicationConfiguration configuration) {
         }
     }
 
+    private void selectConfig(final Map<String, Object> configuration) {
+        if (configuration.size() <= 1) {
+            return;
+        }
+        if (configuration.containsKey("selector")) {
+            final String selector = (String) configuration.get("selector");
+            final String resolvedSelector = PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(
+                selector, System.getProperties()
+            );
+            configuration.entrySet().removeIf(e -> !resolvedSelector.equals(e.getKey()));
 
 Review comment:
   I think you need to add a check and error for selected provider not found, when you give a value to selector, but no suitable provider definition here.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services