Check whether data stream feature flag is enabled before deleting all data streams, (#56517) (#56520)

this will fix the release build.
This commit is contained in:
Martijn van Groningen 2020-05-11 18:34:50 +02:00 committed by GitHub
parent 2be6d7b8b6
commit 32471abc0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -396,7 +396,7 @@ public class ActionModule extends AbstractModule {
private static final Logger logger = LogManager.getLogger(ActionModule.class);
private final boolean transportClient;
private static final boolean DATASTREAMS_FEATURE_ENABLED;
public static final boolean DATASTREAMS_FEATURE_ENABLED;
static {
final String property = System.getProperty("es.datastreams_feature_enabled");

View File

@ -23,6 +23,7 @@ import com.carrotsearch.hppc.ObjectArrayList;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.ActionModule;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.admin.indices.datastream.DeleteDataStreamAction;
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
@ -139,7 +140,8 @@ public abstract class TestCluster implements Closeable {
* Deletes all data streams from the test cluster.
*/
public void wipeAllDataStreams() {
if (size() > 0) {
// Feature flag may not be enabled in all gradle modules that use ESIntegTestCase
if (size() > 0 && ActionModule.DATASTREAMS_FEATURE_ENABLED) {
AcknowledgedResponse response =
client().admin().indices().deleteDataStream(new DeleteDataStreamAction.Request("*")).actionGet();
assertAcked(response);