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:
parent
2be6d7b8b6
commit
32471abc0e
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue