Skip to content

Commit f22b65c

Browse files
authored
[Backport 2.17] Fallback to cluster health on remote info failure (#895)
* fallback if get remote info fails to cluster health call (#886) Signed-off-by: Amit Galitzky <amgalitz@amazon.com> * add correct snapshots Signed-off-by: Amit Galitzky <amgalitz@amazon.com> * change upload artifact version Signed-off-by: Amit Galitzky <amgalitz@amazon.com> --------- Signed-off-by: Amit Galitzky <amgalitz@amazon.com>
1 parent 32f28de commit f22b65c

File tree

3 files changed

+17
-12
lines changed

3 files changed

+17
-12
lines changed

.github/workflows/remote-integ-tests-workflow.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,14 @@ jobs:
153153
working-directory: opensearch-dashboards-functional-test
154154

155155
- name: Capture failure screenshots
156-
uses: actions/upload-artifact@v1
156+
uses: actions/upload-artifact@v2
157157
if: failure()
158158
with:
159159
name: cypress-screenshots-${{ matrix.os }}
160160
path: opensearch-dashboards-functional-test/cypress/screenshots
161161

162162
- name: Capture failure test video
163-
uses: actions/upload-artifact@v1
163+
uses: actions/upload-artifact@v2
164164
if: failure()
165165
with:
166166
name: cypress-videos-${{ matrix.os }}

public/pages/DefineDetector/containers/__tests__/__snapshots__/DefineDetector.test.tsx.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ exports[`<DefineDetector /> empty creating detector definition renders the compo
15931593
xmlns="http://www.w3.org/2000/svg"
15941594
>
15951595
<path
1596-
d="M7.999 15.999a8 8 0 1 1 0-16 8 8 0 0 1 0 16ZM8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM3.5 5h9a.5.5 0 1 1 0 1h-9a.5.5 0 0 1 0-1Zm2 3h5a.5.5 0 1 1 0 1h-5a.5.5 0 0 1 0-1Zm2 3h1a.5.5 0 1 1 0 1h-1a.5.5 0 1 1 0-1Z"
1596+
d="m9.759 12.652-1.8 2.25-.78-.625 1.8-2.25A.1.1 0 0 0 9 11.965V8.362a1 1 0 0 1 .232-.64l4.631-5.558A.1.1 0 0 0 13.787 2H2.213a.1.1 0 0 0-.077.164l4.631 5.558a1 1 0 0 1 .232.64v5.853a.1.1 0 0 0 .178.062l.781.625c-.65.812-1.959.353-1.959-.687V8.362L1.368 2.804C.771 2.088 1.281 1 2.214 1h11.573c.932 0 1.442 1.088.845 1.804L10 8.362v3.603a1.1 1.1 0 0 1-.241.687Z"
15971597
fill-rule="evenodd"
15981598
/>
15991599
</svg>
@@ -2679,7 +2679,7 @@ exports[`<DefineDetector /> empty editing detector definition renders the compon
26792679
xmlns="http://www.w3.org/2000/svg"
26802680
>
26812681
<path
2682-
d="M7.999 15.999a8 8 0 1 1 0-16 8 8 0 0 1 0 16ZM8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14ZM3.5 5h9a.5.5 0 1 1 0 1h-9a.5.5 0 0 1 0-1Zm2 3h5a.5.5 0 1 1 0 1h-5a.5.5 0 0 1 0-1Zm2 3h1a.5.5 0 1 1 0 1h-1a.5.5 0 1 1 0-1Z"
2682+
d="m9.759 12.652-1.8 2.25-.78-.625 1.8-2.25A.1.1 0 0 0 9 11.965V8.362a1 1 0 0 1 .232-.64l4.631-5.558A.1.1 0 0 0 13.787 2H2.213a.1.1 0 0 0-.077.164l4.631 5.558a1 1 0 0 1 .232.64v5.853a.1.1 0 0 0 .178.062l.781.625c-.65.812-1.959.353-1.959-.687V8.362L1.368 2.804C.771 2.088 1.281 1 2.214 1h11.573c.932 0 1.442 1.088.845 1.804L10 8.362v3.603a1.1 1.1 0 0 1-.241.687Z"
26832683
fill-rule="evenodd"
26842684
/>
26852685
</svg>

server/routes/opensearch.ts

+13-8
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,19 @@ export default class OpenSearchService {
570570

571571
let clustersResponse: ClusterInfo[] = [];
572572

573-
const remoteInfo = await callWithRequest('transport.request', {
574-
method: 'GET',
575-
path: '/_remote/info',
576-
});
577-
clustersResponse = Object.keys(remoteInfo).map((key) => ({
578-
name: key,
579-
localCluster: false,
580-
}));
573+
try {
574+
const remoteInfo = await callWithRequest('transport.request', {
575+
method: 'GET',
576+
path: '/_remote/info',
577+
});
578+
clustersResponse = Object.keys(remoteInfo).map((key) => ({
579+
name: key,
580+
localCluster: false,
581+
}));
582+
} catch (remoteErr) {
583+
console.warn('Failed to fetch remote cluster info, proceeding with local datasource info only.', remoteErr);
584+
}
585+
581586

582587
const clusterHealth = await callWithRequest('cat.health', {
583588
format: 'json',

0 commit comments

Comments
 (0)