Deprecate the logstash enabled setting (#53487)
The setting, `xpack.logstash.enabled`, exists to enable or disable the logstash extensions found within x-pack. In practice, this setting had no effect on the functionality of the extension. Given this, the setting is now deprecated in preparation for removal. Backport of #53367
This commit is contained in:
parent
34adfd9611
commit
af36665b08
|
@ -225,7 +225,6 @@ public abstract class CcrIntegTestCase extends ESTestCase {
|
|||
builder.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
|
||||
builder.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
|
||||
builder.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false);
|
||||
builder.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
|
||||
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
|
||||
// Let cluster state api return quickly in order to speed up auto follow tests:
|
||||
builder.put(CcrSettings.CCR_WAIT_FOR_METADATA_TIMEOUT.getKey(), TimeValue.timeValueMillis(100));
|
||||
|
|
|
@ -48,7 +48,6 @@ public abstract class CcrSingleNodeTestCase extends ESSingleNodeTestCase {
|
|||
builder.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
|
||||
builder.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
|
||||
builder.put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false);
|
||||
builder.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
|
||||
builder.put(LicenseService.SELF_GENERATED_LICENSE_TYPE.getKey(), "trial");
|
||||
// Let cluster state api return quickly in order to speed up auto follow tests:
|
||||
builder.put(CcrSettings.CCR_WAIT_FOR_METADATA_TIMEOUT.getKey(), TimeValue.timeValueMillis(100));
|
||||
|
|
|
@ -88,7 +88,7 @@ public class XPackSettings {
|
|||
|
||||
/** Setting for enabling or disabling Logstash extensions. Defaults to true. */
|
||||
public static final Setting<Boolean> LOGSTASH_ENABLED = Setting.boolSetting("xpack.logstash.enabled", true,
|
||||
Setting.Property.NodeScope);
|
||||
Setting.Property.NodeScope, Property.Deprecated);
|
||||
|
||||
/**
|
||||
* Setting for enabling or disabling the index lifecycle extension. Defaults to true.
|
||||
|
|
|
@ -101,7 +101,6 @@ public class IndexLifecycleInitialisationTests extends ESIntegTestCase {
|
|||
settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
|
||||
settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
|
||||
settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false);
|
||||
settings.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
|
||||
settings.put(LifecycleSettings.LIFECYCLE_POLL_INTERVAL, "1s");
|
||||
|
||||
// This is necessary to prevent ILM and SLM installing a lifecycle policy, these tests assume a blank slate
|
||||
|
|
|
@ -50,7 +50,6 @@ public class SnapshotLifecycleInitialisationTests extends ESSingleNodeTestCase {
|
|||
settings.put(XPackSettings.WATCHER_ENABLED.getKey(), false);
|
||||
settings.put(XPackSettings.MONITORING_ENABLED.getKey(), false);
|
||||
settings.put(XPackSettings.GRAPH_ENABLED.getKey(), false);
|
||||
settings.put(XPackSettings.LOGSTASH_ENABLED.getKey(), false);
|
||||
settings.put(Environment.PATH_REPO_SETTING.getKey(), repositoryLocation);
|
||||
|
||||
settings.put(XPackSettings.SNAPSHOT_LIFECYCLE_ENABLED.getKey(), true);
|
||||
|
|
|
@ -15,7 +15,6 @@ import org.elasticsearch.indices.SystemIndexDescriptor;
|
|||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.plugins.SystemIndexPlugin;
|
||||
import org.elasticsearch.xpack.core.XPackPlugin;
|
||||
import org.elasticsearch.xpack.core.XPackSettings;
|
||||
import org.elasticsearch.xpack.core.template.TemplateUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -36,21 +35,7 @@ public class Logstash extends Plugin implements SystemIndexPlugin {
|
|||
private static final String OLD_LOGSTASH_INDEX_NAME = "logstash-index-template";
|
||||
private static final String TEMPLATE_VERSION_VARIABLE = "logstash.template.version";
|
||||
|
||||
private final boolean enabled;
|
||||
private final boolean transportClientMode;
|
||||
|
||||
public Logstash(Settings settings) {
|
||||
this.enabled = XPackSettings.LOGSTASH_ENABLED.get(settings);
|
||||
this.transportClientMode = XPackPlugin.transportClientMode(settings);
|
||||
}
|
||||
|
||||
boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
boolean isTransportClient() {
|
||||
return transportClientMode;
|
||||
}
|
||||
public Logstash() {}
|
||||
|
||||
public Collection<Module> createGuiceModules() {
|
||||
List<Module> modules = new ArrayList<>();
|
||||
|
|
|
@ -7,10 +7,12 @@ package org.elasticsearch.xpack.logstash;
|
|||
|
||||
import org.elasticsearch.action.support.PlainActionFuture;
|
||||
import org.elasticsearch.common.io.stream.BytesStreamOutput;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.XPackLicenseState;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.xpack.core.XPackFeatureSet;
|
||||
import org.elasticsearch.xpack.core.XPackSettings;
|
||||
import org.elasticsearch.xpack.core.logstash.LogstashFeatureSetUsage;
|
||||
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
@ -33,6 +35,8 @@ public class LogstashFeatureSetTests extends ESTestCase {
|
|||
usage.writeTo(out);
|
||||
XPackFeatureSet.Usage serializedUsage = new LogstashFeatureSetUsage(out.bytes().streamInput());
|
||||
assertThat(serializedUsage.enabled(), is(enabled));
|
||||
|
||||
assertSettingDeprecationsAndWarnings(new Setting<?>[] { XPackSettings.LOGSTASH_ENABLED });
|
||||
}
|
||||
|
||||
public void testEnabledDefault() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue