Skip to content

Commit

Permalink
Fix: remove warning message on cluster UUID retrieval failure with AO…
Browse files Browse the repository at this point in the history
…SS. (#237)

Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Feb 28, 2024
1 parent 6d043dc commit d60a58f
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/logstash/plugin_mixins/opensearch/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def after_successful_connection(&block)

def discover_cluster_uuid
return unless defined?(plugin_metadata)
return if params && params['auth_type'] && params['auth_type']['service_name'] == "aoss" # AOSS doesn't support GET /
cluster_info = client.get('/')
plugin_metadata.set(:cluster_uuid, cluster_info['cluster_uuid'])
rescue => e
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
## Version 2.0.1 Release Notes

Compatible with OpenSearch 1.3+, 2.0+

### Bug Fixes

* Fix a gzip compression issue when sending partial bulk requests (#183)

### Documentation

* Update the OpenSearch documentation website link for this plugin (#178)
* Updated MAINTAINERS.md format. (#185)

### Infrastructure

* Add release workflows (#188)
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
Compatible with OpenSearch 1.3+, 2.0+

### Bug Fixes

* Encode body before signing to match manticore adapter encoding. ([#207](https://github.com/opensearch-project/logstash-output-opensearch/issues/207))

### Documentation

* Baselines the MAINTAINERS.md and CODEOWNERS files. ([#196](https://github.com/opensearch-project/logstash-output-opensearch/issues/196))

11 changes: 11 additions & 0 deletions release-notes/logstash-output-opensearch-release-notes-next.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Version 2.0.3 Release Notes

Compatible with OpenSearch 1.3+, 2.0+

### Bug Fixes

* Fix warning retrieving cluster UUID with Amazon OpenSearch Serverless (#237)

### Documentation

### Infrastructure
24 changes: 24 additions & 0 deletions spec/unit/outputs/opensearch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,30 @@
expect(logger).to have_received(:error).with(/Unable to retrieve OpenSearch cluster uuid/i, anything)
end

context 'with iam auth' do
context 'es' do
let(:options) { { 'hosts' => '127.0.0.1:9999', 'auth_type' => { 'service_name' => 'es' } } }
it "logs inability to retrieve uuid" do
allow(subject).to receive(:install_template)
subject.register
subject.send :wait_for_successful_connection

expect(logger).to have_received(:error).with(/Unable to retrieve OpenSearch cluster uuid/i, anything)
end
end

context 'aoss' do
let(:options) { { 'hosts' => '127.0.0.1:9999', 'auth_type' => { 'service_name' => 'aoss' } } }
it "does not attempt to retrieve uuid" do
allow(subject).to receive(:install_template)
subject.register
subject.send :wait_for_successful_connection

expect(logger).to_not have_received(:error)
end
end
end

it "logs template install failure" do
allow(subject).to receive(:discover_cluster_uuid)
subject.register
Expand Down

0 comments on commit d60a58f

Please sign in to comment.