From 768e161af4b26bb69c090e4b6cbcc9db22b848f0 Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Fri, 22 Mar 2024 17:21:47 -0400 Subject: [PATCH] Get actual value from settings and default from ff setting Signed-off-by: Craig Perkins --- .../main/java/org/opensearch/common/util/FeatureFlags.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/common/util/FeatureFlags.java b/server/src/main/java/org/opensearch/common/util/FeatureFlags.java index 3a926721dad40..bdfce72d106d3 100644 --- a/server/src/main/java/org/opensearch/common/util/FeatureFlags.java +++ b/server/src/main/java/org/opensearch/common/util/FeatureFlags.java @@ -124,7 +124,10 @@ public class FeatureFlags { public static void initializeFeatureFlags(Settings openSearchSettings) { Settings.Builder settingsBuilder = Settings.builder(); for (Setting ffSetting : ALL_FEATURE_FLAG_SETTINGS) { - settingsBuilder = settingsBuilder.put(ffSetting.getKey(), ffSetting.getDefault(openSearchSettings)); + settingsBuilder = settingsBuilder.put( + ffSetting.getKey(), + openSearchSettings.getAsBoolean(ffSetting.getKey(), ffSetting.getDefault(openSearchSettings)) + ); } settings = settingsBuilder.build(); }