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

Multiple Import Metadata actions #1178

Merged
merged 18 commits into from
Jun 26, 2024
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ public void deleteMetadataFromDataSource(DataSourceInfo dataSource) {
*/
public void saveMetadataFromDataSourceToDB(DataSourceInfo dataSourceInfo) {
try {
if (null == dataSourceInfo) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shreyabiradar07 - As discussed, please add the negative scenario to bring down the prometheus by scaling down the statefulset and deployment between multiple imports, and validate that the second call to import metadata fails with appropriate error message and list metadata returns the metadata from the DB. This can be added in a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chandrams - created #1211 adding a negative scenario to test multiple metadata imports by bringing down prometheus server instance following the above approach. Please review the same, thanks!

throw new DataSourceDoesNotExist(KruizeConstants.DataSourceConstants.DataSourceErrorMsgs.MISSING_DATASOURCE_INFO);
}

DataSourceMetadataInfo dataSourceMetadataInfo = dataSourceMetadataOperator.getDataSourceMetadataInfo(dataSourceInfo);
if (null == dataSourceMetadataInfo) {
LOGGER.error(KruizeConstants.DataSourceConstants.DataSourceMetadataErrorMsgs.DATASOURCE_METADATA_INFO_NOT_AVAILABLE, "for datasource {}" + dataSourceInfo.getName());
Expand Down Expand Up @@ -163,6 +167,9 @@ private boolean checkIfDataSourceMetadataExists(String dataSourceName) {
*/
public void deleteMetadataFromDBByDataSource(DataSourceInfo dataSourceInfo) {
try {
if (null == dataSourceInfo) {
throw new DataSourceDoesNotExist(KruizeConstants.DataSourceConstants.DataSourceErrorMsgs.MISSING_DATASOURCE_INFO);
}
String dataSourceName = dataSourceInfo.getName();
DataSourceMetadataInfo dataSourceMetadataInfo = fetchDataSourceMetadataFromDBByName(dataSourceName, "false");
if (null == dataSourceMetadataInfo) {
Expand Down
Loading