diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java index 6c342c0c85c..2053fc23124 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/Autoscaling.java @@ -33,7 +33,7 @@ import java.util.function.Supplier; */ public class Autoscaling extends Plugin implements ActionPlugin { - private static final boolean AUTOSCALING_FEATURE_FLAG_REGISTERED; + private static final Boolean AUTOSCALING_FEATURE_FLAG_REGISTERED; static { final String property = System.getProperty("es.autoscaling_feature_flag_registered"); @@ -42,8 +42,10 @@ public class Autoscaling extends Plugin implements ActionPlugin { } if ("true".equals(property)) { AUTOSCALING_FEATURE_FLAG_REGISTERED = true; - } else if ("false".equals(property) || property == null) { + } else if ("false".equals(property)) { AUTOSCALING_FEATURE_FLAG_REGISTERED = false; + } else if (property == null) { + AUTOSCALING_FEATURE_FLAG_REGISTERED = null; } else { throw new IllegalArgumentException( "expected es.autoscaling_feature_flag_registered to be unset or [true|false] but was [" + property + "]" @@ -70,7 +72,7 @@ public class Autoscaling extends Plugin implements ActionPlugin { */ @Override public List> getSettings() { - if (isSnapshot() || AUTOSCALING_FEATURE_FLAG_REGISTERED) { + if (isSnapshot() || (AUTOSCALING_FEATURE_FLAG_REGISTERED != null && AUTOSCALING_FEATURE_FLAG_REGISTERED)) { return Collections.singletonList(AUTOSCALING_ENABLED_SETTING); } else { return Collections.emptyList();