Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Manual Backport 2.x] Add support for register data sources during the absence of local cluster #2144

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
constructor(initializerContext: PluginInitializerContext) {
this.config = initializerContext.config.get<PublicConfig>();
}
private mdsFlagStatus: boolean = false;

public setup(
core: CoreSetup<AppPluginStartDependencies>,
Expand All @@ -184,6 +185,7 @@
});

setupOverviewPage(setupDeps.contentManagement!);
this.mdsFlagStatus = !!setupDeps.dataSource;

// redirect legacy notebooks URL to current URL under observability
if (window.location.pathname.includes('notebooks-dashboards')) {
Expand Down Expand Up @@ -459,17 +461,18 @@
return `${type.charAt(0).toUpperCase()}${type.slice(1)}`;
};

// register all s3 datasources
// register all s3 datasources only if mds feature flag is disabled
if (!this.mdsFlagStatus) {
const registerDataSources = () => {

Check failure on line 466 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
try {

Check failure on line 467 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
core.http.get(`${DATACONNECTIONS_BASE}`).then((s3DataSources) => {

Check failure on line 468 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
s3DataSources.map((s3ds) => {

Check failure on line 469 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
dataSourceService.registerDataSource(

Check failure on line 470 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
dataSourceFactory.getDataSourceInstance(S3_DATA_SOURCE_TYPE, {

Check failure on line 471 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
id: htmlIdGenerator(OBS_S3_DATA_SOURCE)(),

Check failure on line 472 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
name: s3ds.name,

Check failure on line 473 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
type: s3ds.connector.toLowerCase(),

Check failure on line 474 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
metadata: {

Check failure on line 475 in public/plugin.tsx

View workflow job for this annotation

GitHub Actions / Lint

Insert `··`
...s3ds.properties,
ui: {
label: s3ds.name,
Expand Down Expand Up @@ -509,6 +512,7 @@
} else {
registerDataSources();
}
}

core.http.intercept({
request: catalogRequestIntercept(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Compatible with OpenSearch and OpenSearch Dashboards version 2.17.0
* [query assist] update api handler to accommodate new ml-commons config response ([#2111](https://github.com/opensearch-project/dashboards-observability/pull/2111))
* Update trace analytics landing page ([#2125](https://github.com/opensearch-project/dashboards-observability/pull/2125))
* [query assist] update ml-commons response schema ([#2124](https://github.com/opensearch-project/dashboards-observability/pull/2124))
* [MDS] Add support for register data sources during the absence of local cluster ([#2140](https://github.com/opensearch-project/dashboards-observability/pull/2140))

### Bug Fixes
* [Bug] Trace Analytics bug fix for local cluster being rendered ([#2006](https://github.com/opensearch-project/dashboards-observability/pull/2006))
Expand Down
Loading