Skip to content

Commit

Permalink
Adding system indices and filtering out deletion based on system inde…
Browse files Browse the repository at this point in the history
…x prefix

Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis committed Jan 31, 2024
1 parent bd6b2aa commit b6e277a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
27 changes: 27 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,33 @@ testClusters.integTest {
setting("plugins.security.authcz.admin_dn", "\n- CN=kirk,OU=client,O=client,L=test, C=de")
setting('plugins.security.restapi.roles_enabled', '["all_access", "security_rest_api_access"]')
setting('plugins.security.system_indices.enabled', "true")
setting('plugins.security.system_indices.indices', '[' +
'".plugins-ml-config", ' +
'".plugins-ml-connector", ' +
'".plugins-ml-model-group", ' +
'".plugins-ml-model", ".plugins-ml-task", ' +
'".plugins-ml-conversation-meta", ' +
'".plugins-ml-conversation-interactions", ' +
'".opendistro-alerting-config", ' +
'".opendistro-alerting-alert*", ' +
'".opendistro-anomaly-results*", ' +
'".opendistro-anomaly-detector*", ' +
'".opendistro-anomaly-checkpoints", ' +
'".opendistro-anomaly-detection-state", ' +
'".opendistro-reports-*", ' +
'".opensearch-notifications-*", ' +
'".opensearch-notebooks", ' +
'".opensearch-observability", ' +
'".ql-datasources", ' +
'".opendistro-asynchronous-search-response*", ' +
'".replication-metadata-store", ' +
'".opensearch-knn-models", ' +
'".geospatial-ip2geo-data*", ' +
'".plugins-flow-framework-config", ' +
'".plugins-flow-framework-templates", ' +
'".plugins-flow-framework-state"' +
']'
)
setSecure(true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ protected void wipeAllODFEIndices() throws IOException {
// Do not reset ML/Flow Framework encryption index as this is needed to encrypt connector credentials
if (indexName != null
&& !".opendistro_security".equals(indexName)
&& !".plugins-ml-config".equals(indexName)
&& !".plugins-flow-framework-config".equals(indexName)) {
&& !indexName.startsWith(".opensearch")
&& !indexName.startsWith(".plugins-flow-framework")
&& !indexName.startsWith(".plugins-ml")) {
adminClient().performRequest(new Request("DELETE", "/" + indexName));
}
}
Expand Down

0 comments on commit b6e277a

Please sign in to comment.