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

[Backport 2.17] [MDS] Mute the non-mds endpoints for direct query data connections #8637

Merged
merged 1 commit into from
Oct 18, 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
2 changes: 2 additions & 0 deletions changelogs/fragments/8537.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- [MDS] Mute the non-mds endpoints for direct query data connections ([#8537](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8537))
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
};

export const getLocalClusterConnections = async (http: HttpSetup) => {
const res = await http.get(`${DATACONNECTIONS_BASE}`);
const res = await http.get(`${DATACONNECTIONS_BASE}/dataSourceMDSId=`);

Check warning on line 71 in src/plugins/data_source_management/public/components/utils.ts

View check run for this annotation

Codecov / codecov/patch

src/plugins/data_source_management/public/components/utils.ts#L71

Added line #L71 was not covered by tests
const localClusterConnections: DataSourceTableItem[] = res.map(
(dataConnection: DirectQueryDatasourceDetails) => ({
id: `${dataConnection.name}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
EDIT,
} from '../../framework/utils/shared';

export function registerDataConnectionsRoute(router: IRouter, dataSourceEnabled: boolean) {
export function registerNonMdsDataConnectionsRoute(router: IRouter) {
router.get(
{
path: `${DATACONNECTIONS_BASE}/{name}`,
Expand Down Expand Up @@ -204,7 +204,9 @@ export function registerDataConnectionsRoute(router: IRouter, dataSourceEnabled:
}
}
);
}

export function registerDataConnectionsRoute(router: IRouter, dataSourceEnabled: boolean) {
router.get(
{
path: `${DATACONNECTIONS_BASE}/dataSourceMDSId={dataSourceMDSId?}`,
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/data_source_management/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

import { IRouter, ILegacyClusterClient } from '../../../../core/server';
import { registerDslRoute } from './dsl';
import { registerDataConnectionsRoute } from './data_connections_router';
import {
registerDataConnectionsRoute,
registerNonMdsDataConnectionsRoute,
} from './data_connections_router';
import { registerDatasourcesRoute } from './datasources_router';
import { registerPplRoute } from './ppl';
import { DSLFacet } from '../services/facets/dsl_facet';
Expand Down Expand Up @@ -43,6 +46,9 @@ export function setupRoutes({
// const queryService = new QueryService(client);
// registerSqlRoute(router, queryService);

if (!dataSourceEnabled) {
registerNonMdsDataConnectionsRoute(router);
}
registerDataConnectionsRoute(router, dataSourceEnabled);
registerDatasourcesRoute(router, dataSourceEnabled);
}
Loading