Skip to content

Commit

Permalink
Add support for rigister plugin during the absence of local cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <jiallian@amazon.com>
  • Loading branch information
RyanL1997 committed Sep 6, 2024
1 parent 87197a4 commit c824975
Showing 1 changed file with 5 additions and 1 deletion.
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 @@ export class ObservabilityPlugin
constructor(initializerContext: PluginInitializerContext) {
this.config = initializerContext.config.get<PublicConfig>();
}
private mdsFlagStatus: boolean = false;

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

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,7 +461,8 @@ export class ObservabilityPlugin
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 `··`
Expand Down Expand Up @@ -509,6 +512,7 @@ export class ObservabilityPlugin
} else {
registerDataSources();
}
}

core.http.intercept({
request: catalogRequestIntercept(),
Expand Down

0 comments on commit c824975

Please sign in to comment.