Skip to content

Commit d60a58f

Browse files
authored
Fix: remove warning message on cluster UUID retrieval failure with AOSS. (#237)
Signed-off-by: dblock <[email protected]>
1 parent 6d043dc commit d60a58f

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed

lib/logstash/plugin_mixins/opensearch/common.rb

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def after_successful_connection(&block)
8787

8888
def discover_cluster_uuid
8989
return unless defined?(plugin_metadata)
90+
return if params && params['auth_type'] && params['auth_type']['service_name'] == "aoss" # AOSS doesn't support GET /
9091
cluster_info = client.get('/')
9192
plugin_metadata.set(:cluster_uuid, cluster_info['cluster_uuid'])
9293
rescue => e
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
## Version 2.0.1 Release Notes
2+
23
Compatible with OpenSearch 1.3+, 2.0+
34

45
### Bug Fixes
6+
57
* Fix a gzip compression issue when sending partial bulk requests (#183)
68

79
### Documentation
10+
811
* Update the OpenSearch documentation website link for this plugin (#178)
912
* Updated MAINTAINERS.md format. (#185)
1013

1114
### Infrastructure
15+
1216
* Add release workflows (#188)

release-notes/logstash-output-opensearch-release-notes-2.0.2.md

+2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
Compatible with OpenSearch 1.3+, 2.0+
44

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

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

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Version 2.0.3 Release Notes
2+
3+
Compatible with OpenSearch 1.3+, 2.0+
4+
5+
### Bug Fixes
6+
7+
* Fix warning retrieving cluster UUID with Amazon OpenSearch Serverless (#237)
8+
9+
### Documentation
10+
11+
### Infrastructure

spec/unit/outputs/opensearch_spec.rb

+24
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,30 @@
776776
expect(logger).to have_received(:error).with(/Unable to retrieve OpenSearch cluster uuid/i, anything)
777777
end
778778

779+
context 'with iam auth' do
780+
context 'es' do
781+
let(:options) { { 'hosts' => '127.0.0.1:9999', 'auth_type' => { 'service_name' => 'es' } } }
782+
it "logs inability to retrieve uuid" do
783+
allow(subject).to receive(:install_template)
784+
subject.register
785+
subject.send :wait_for_successful_connection
786+
787+
expect(logger).to have_received(:error).with(/Unable to retrieve OpenSearch cluster uuid/i, anything)
788+
end
789+
end
790+
791+
context 'aoss' do
792+
let(:options) { { 'hosts' => '127.0.0.1:9999', 'auth_type' => { 'service_name' => 'aoss' } } }
793+
it "does not attempt to retrieve uuid" do
794+
allow(subject).to receive(:install_template)
795+
subject.register
796+
subject.send :wait_for_successful_connection
797+
798+
expect(logger).to_not have_received(:error)
799+
end
800+
end
801+
end
802+
779803
it "logs template install failure" do
780804
allow(subject).to receive(:discover_cluster_uuid)
781805
subject.register

0 commit comments

Comments
 (0)