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

Add support to ignore updates on autofollow pattern #1449

Merged
merged 3 commits into from
Sep 11, 2024

Conversation

ankitkala
Copy link
Member

@ankitkala ankitkala commented Sep 10, 2024

Description

  • Exception handling was added for Autofollow update in the change below but tests weren't handling it gracefully. Added a flag to ignore ResourceAlreadyExists exception.
  • Also updated Github action to use upload-artifact@v4 and checkout action.

Related Issues

#1433

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

monusingh-1
monusingh-1 previously approved these changes Sep 10, 2024
Signed-off-by: Ankit Kala <[email protected]>
assertThat(response.isAcknowledged).isTrue()
} catch (e: ResponseException) {
// Skip if ignoreIfExists is true and exception contains resource_already_exists_exception
if ((ignoreIfExists == true && e.message?.contains("resource_already_exists_exception")!!) == false) throw e
Copy link
Member

Choose a reason for hiding this comment

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

If ignoreIfExists is false then exception will not be thrown. Is that the expected behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

sorry, the check is slightly confusing. If ignoreIfExists is false, it will throw the exception

@ankitkala ankitkala merged commit 5fa1325 into opensearch-project:main Sep 11, 2024
9 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants