Closed cwperks closed 1 day ago
Attention: Patch coverage is 70.00000%
with 3 lines
in your changes missing coverage. Please review.
Project coverage is 65.21%. Comparing base (
6dedfb4
) to head (0a6cde9
).
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/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4497-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 34da6e86fbcdaf2b87a3dadf33e1c53e425b280e
# Push it to GitHub
git push --set-upstream origin backport/backport-4497-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x
Then, create a pull request where the base
branch is 2.x
and the compare
/head
branch is backport/backport-4497-to-2.x
.
Description
Fixes a NullPointerException that occurs on a Closed index request. This fixes an issue seen after the merge of https://github.com/opensearch-project/security/pull/4370 which made a change to get the list of metaFields from the mapperService in core. On close index requests,
indexService.mapperService()
can return null so the call toindexService.mapperService().getMetadataFields()
throws an NPE.This fix checks for Close index requests and handles the scenario accordingly. Closed indices are not searchable so there's no need to have a list of metaFields for a closed index.
Ref: https://opensearch.org/docs/latest/api-reference/index-apis/close-index/
Bug fix
Issues Resolved
Check List
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.