From 402e8b666e8ef792faed9ad7305301a6b469b5c0 Mon Sep 17 00:00:00 2001 From: Michael Froh Date: Wed, 5 Apr 2023 18:45:57 +0000 Subject: [PATCH] Move REST handlers behind feature flag Signed-off-by: Michael Froh --- .../src/main/java/org/opensearch/action/ActionModule.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/ActionModule.java b/server/src/main/java/org/opensearch/action/ActionModule.java index 8812bdc4e3186..7346ccc2e3829 100644 --- a/server/src/main/java/org/opensearch/action/ActionModule.java +++ b/server/src/main/java/org/opensearch/action/ActionModule.java @@ -931,9 +931,11 @@ public void initRestHandlers(Supplier nodesInCluster) { registerHandler.accept(new RestDeleteDecommissionStateAction()); // Search pipelines API - registerHandler.accept(new RestPutSearchPipelineAction()); - registerHandler.accept(new RestGetSearchPipelineAction()); - registerHandler.accept(new RestDeleteSearchPipelineAction()); + if (FeatureFlags.isEnabled(FeatureFlags.SEARCH_PIPELINE)) { + registerHandler.accept(new RestPutSearchPipelineAction()); + registerHandler.accept(new RestGetSearchPipelineAction()); + registerHandler.accept(new RestDeleteSearchPipelineAction()); + } for (ActionPlugin plugin : actionPlugins) { for (RestHandler handler : plugin.getRestHandlers(