-
Notifications
You must be signed in to change notification settings - Fork 894
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
[Discover] Filter out OpenSearch Serverless Collections #8758
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -120,11 +120,15 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
perPage: 10000, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
const dataSources: DataStructure[] = [DEFAULT_DATA.STRUCTURES.LOCAL_DATASOURCE].concat( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
response.savedObjects.map((savedObject) => ({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id: savedObject.id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title: savedObject.attributes.title, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: 'DATA_SOURCE', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
response.savedObjects | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.filter( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(savedObject) => savedObject.attributes.dataSourceEngineType !== 'OpenSearch Serverless' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we got the okay to filter out serverless then this looks good to me! definitely not a blocker for this PR or more of a question: do we think it would be worth it for the dataset type config to have a a value we could respect is this will help future proof us like
for scenarios like maybe a specific feature on a cluster. cc: @virajsanghvi @AMoo-Miki any opinions on this one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A. If AWS wants to filter something out, they are more than welcome to patch it in their fork. OpenSearch logic should not contain opinions for AWS. OSD is not the one who defined There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah that's true. something that we sometimes run into is like the query assist be available on only certain clusters and version. but yeah that would be too complicated and i think we would should solve that more universally with capability APIs There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree this should ideally be capabilities based There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this use the enum instead of string
If OSD allows users to add OpenSearch serverless as datasources to it, I think this is not an opinion for AWS, it's a limitation that this combination does not work in OSD?
q: who is defining the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be the
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks for finding that. It should have never happened.
Found it in the data_source: OpenSearch-Dashboards/src/plugins/data_source/server/routes/data_source_connection_validator.ts Lines 41 to 71 in 190dab0
Apparently all of these was added to OSD :/ |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
.map((savedObject) => ({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id: savedObject.id, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
title: savedObject.attributes.title, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
type: 'DATA_SOURCE', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
return injectMetaToDataStructures(dataSources); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,17 +198,21 @@ const fetchDataSources = async (client: SavedObjectsClientContract): Promise<Dat | |
}); | ||
const dataSources: DataStructure[] = [DEFAULT_DATA.STRUCTURES.LOCAL_DATASOURCE]; | ||
return dataSources.concat( | ||
resp.savedObjects.map((savedObject) => ({ | ||
id: savedObject.id, | ||
title: savedObject.attributes.title, | ||
type: 'DATA_SOURCE', | ||
meta: { | ||
query: { | ||
id: savedObject.id, | ||
}, | ||
type: DATA_STRUCTURE_META_TYPES.CUSTOM, | ||
} as DataStructureCustomMeta, | ||
})) | ||
resp.savedObjects | ||
.filter( | ||
(savedObject) => savedObject.attributes.dataSourceEngineType !== 'OpenSearch Serverless' | ||
sejli marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is attributes guaranteed to be defined? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Attributes is guaranteed to be defined, but not sure about
|
||
) | ||
.map((savedObject) => ({ | ||
id: savedObject.id, | ||
title: savedObject.attributes.title, | ||
type: 'DATA_SOURCE', | ||
meta: { | ||
query: { | ||
id: savedObject.id, | ||
}, | ||
type: DATA_STRUCTURE_META_TYPES.CUSTOM, | ||
} as DataStructureCustomMeta, | ||
})) | ||
); | ||
}; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this file has tests as well we can add which should be copy pasta from the other one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it can be another PR