Skip to content

Commit

Permalink
Acknowledge all default modules as ES plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeelia committed Feb 23, 2024
1 parent e789e14 commit 4b0de0e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions includes/classes/Elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1483,18 +1483,22 @@ public function set_elasticsearch_info( $force = false ) {
// Save version of last node. We assume all nodes are same version.
$this->elasticsearch_version = $node['version'];

// Elasticsearch calls "modules" all default plugins that can't be uninstalled
if ( isset( $node['modules'] ) && is_array( $node['modules'] ) ) {
foreach ( $node['modules'] as $plugin ) {
$this->elasticsearch_plugins[ $plugin['name'] ] = $plugin['version'];
}

if ( ! empty( $node['modules'] ) && ! empty( $node['modules'][0]['opensearch_version'] ) ) {
$this->server_type = 'opensearch';
}
}

if ( isset( $node['plugins'] ) && is_array( $node['plugins'] ) ) {
foreach ( $node['plugins'] as $plugin ) {
$this->elasticsearch_plugins[ $plugin['name'] ] = $plugin['version'];
}
}
if ( isset( $node['modules'] )
&& is_array( $node['modules'] )
&& ! empty( $node['modules'] )
&& ! empty( $node['modules'][0]['opensearch_version'] )
) {
$this->server_type = 'opensearch';
}
}

/**
Expand Down

0 comments on commit 4b0de0e

Please sign in to comment.