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

Use adminClient when searching system index in integ tests #1286

Merged
merged 3 commits into from
Oct 29, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Oct 29, 2024

Description

This PR fixes test failures when running with Security. There are instances in integ tests where the integ test will directly search a system index and should be done with the adminClient.

The reason the tests passed in 2.17 and are failing now is due to a bugfix going into 2.18: opensearch-project/security#4774

In 2.17, security started protecting system indices registered with SystemIndexPlugin.getSystemIndexDescriptors() by default. Admin operations like delete index or write to index are explicitly denied for all users except a user connecting with the admin certificate. Search operations will give back a 200 response, but it will return empty results. In 2.17 there was an issue with the indices registered in core that allowed them to be directly searched by an admin user that has been fixed in 2.18.

Related Issues

Resolves #1269

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.

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
@vikasvb90 vikasvb90 merged commit ca2ada2 into opensearch-project:main Oct 29, 2024
16 of 17 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/index-management/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/index-management/backport-2.x
# Create a new branch
git switch --create backport/backport-1286-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ca2ada20d59be44d0cd10c38658eb9eb20c1d64c
# Push it to GitHub
git push --set-upstream origin backport/backport-1286-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/index-management/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-1286-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.18 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/index-management/backport-2.18 2.18
# Navigate to the new working tree
pushd ../.worktrees/index-management/backport-2.18
# Create a new branch
git switch --create backport/backport-1286-to-2.18
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ca2ada20d59be44d0cd10c38658eb9eb20c1d64c
# Push it to GitHub
git push --set-upstream origin backport/backport-1286-to-2.18
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/index-management/backport-2.18

Then, create a pull request where the base branch is 2.18 and the compare/head branch is backport/backport-1286-to-2.18.

cwperks added a commit to cwperks/index-management that referenced this pull request Oct 29, 2024
…h-project#1286)

* Use adminClient when searching system index in integ tests

Signed-off-by: Craig Perkins <[email protected]>

* Replace more instances

Signed-off-by: Craig Perkins <[email protected]>

* Another instance

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ca2ada2)
cwperks added a commit to cwperks/index-management that referenced this pull request Oct 29, 2024
…h-project#1286)

* Use adminClient when searching system index in integ tests

Signed-off-by: Craig Perkins <[email protected]>

* Replace more instances

Signed-off-by: Craig Perkins <[email protected]>

* Another instance

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ca2ada2)
vikasvb90 pushed a commit that referenced this pull request Oct 29, 2024
…1287)

* Use adminClient when searching system index in integ tests

Signed-off-by: Craig Perkins <[email protected]>

* Replace more instances

Signed-off-by: Craig Perkins <[email protected]>

* Another instance

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ca2ada2)
vikasvb90 pushed a commit that referenced this pull request Oct 29, 2024
…1288)

* Use adminClient when searching system index in integ tests

Signed-off-by: Craig Perkins <[email protected]>

* Replace more instances

Signed-off-by: Craig Perkins <[email protected]>

* Another instance

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ca2ada2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AUTOCUT] Integration Test failed for index-management: 2.18.0
2 participants