Skip to content

Permit autoscaling feature flag in release builds #52088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ testClusters.integTest {
if (singleNode().testDistribution == DEFAULT) {
setting 'xpack.license.self_generated.type', 'trial'
setting 'indices.lifecycle.history_index_enabled', 'false'
if (BuildParams.isSnapshotBuild() == false) {
systemProperty 'es.autoscaling_feature_flag_registered', 'true'
}
setting 'xpack.autoscaling.enabled', 'true'
if (BuildParams.isSnapshotBuild()) {
setting 'xpack.autoscaling.enabled', 'true'
setting 'xpack.eql.enabled', 'true'
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@
*/
public class Autoscaling extends Plugin implements ActionPlugin {

private static final boolean AUTOSCALING_FEATURE_FLAG_REGISTERED;

static {
final String property = System.getProperty("es.autoscaling_feature_flag_registered");
if (Build.CURRENT.isSnapshot() && property != null) {
throw new IllegalArgumentException("es.autoscaling_feature_flag_registered is only supported in non-snapshot builds");
}
if ("true".equals(property)) {
AUTOSCALING_FEATURE_FLAG_REGISTERED = true;
} else if ("false".equals(property) || property == null) {
AUTOSCALING_FEATURE_FLAG_REGISTERED = false;
} else {
throw new IllegalArgumentException(
"expected es.autoscaling_feature_flag_registered to be unset or [true|false] but was [" + property + "]"
);
}
}

public static final Setting<Boolean> AUTOSCALING_ENABLED_SETTING = Setting.boolSetting(
"xpack.autoscaling.enabled",
false,
Expand All @@ -51,7 +69,7 @@ public Autoscaling(final Settings settings) {
*/
@Override
public List<Setting<?>> getSettings() {
if (isSnapshot()) {
if (isSnapshot() || AUTOSCALING_FEATURE_FLAG_REGISTERED) {
return List.of(AUTOSCALING_ENABLED_SETTING);
} else {
return List.of();
Expand Down