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

Adds ExtensionsManager.lookupExtensionSettingsById #7466

Merged

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented May 8, 2023

Description

Companion PR in the security plugin: opensearch-project/security#2749

Adds a public method to lookup extension settings placed in extensions.yml by the extension unique id. There was a recent issue with extension handshake and the security plugin where the only available method exposed looks up initialized extensions which is not populated at the time of initial handshake: opensearch-project/security#2747

This new method is utilized in the security plugin to ensure that the unique id exists in extensions.yml so that it can permit the transport requests that an extension uses to bootstrap

Related Issues

Resolves opensearch-project/security#2747

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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]>
@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented May 8, 2023

Codecov Report

Merging #7466 (00f3ece) into main (6ac3317) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff              @@
##               main    #7466      +/-   ##
============================================
- Coverage     70.55%   70.51%   -0.05%     
- Complexity    59666    59684      +18     
============================================
  Files          4887     4887              
  Lines        286559   286562       +3     
  Branches      41307    41307              
============================================
- Hits         202193   202057     -136     
- Misses        67727    67878     +151     
+ Partials      16639    16627      -12     
Impacted Files Coverage Δ
...a/org/opensearch/extensions/ExtensionsManager.java 47.87% <100.00%> (+0.61%) ⬆️

... and 479 files with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.discovery.StableClusterManagerDisruptionIT.testStaleClusterManagerNotHijackingMajority
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

Signed-off-by: Craig Perkins <[email protected]>
@peternied peternied added the backport 2.x Backport to 2.x branch label May 9, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Craig Perkins <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.indices.replication.SegmentReplicationIT.testReplicationPostDeleteAndForceMerge

@peternied
Copy link
Member

@cwperks Could you please investigate the test failure to see if this is a flaky test?

org.opensearch.indices.replication.SegmentReplicationIT.testReplicationPostDeleteAndForceMerge

@cwperks
Copy link
Member Author

cwperks commented May 9, 2023

@peternied This test showed up with flaky test finder according to this comment: #6761 (comment)

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

Nicely done. This will fix the TLS setup issue with extensions!

@saratvemulapalli saratvemulapalli merged commit 16555e4 into opensearch-project:main May 9, 2023
@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:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7466-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 16555e42ca5a0058133f2769a617a1e6ef200c27
# Push it to GitHub
git push --set-upstream origin backport/backport-7466-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

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

@cwperks
Copy link
Member Author

cwperks commented May 9, 2023

I'll open a manual backport for this

cwperks added a commit to cwperks/OpenSearch that referenced this pull request May 9, 2023
…t#7466)

* Add ExtensionsManager.lookupExtensionSettings

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

* Small change to name

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

* Add to CHANGELOG

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

* Move extensionSettingsMap.put

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

* Re-run CI

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

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit 16555e4)
saratvemulapalli pushed a commit that referenced this pull request May 10, 2023
)

* Adds ExtensionsManager.lookupExtensionSettingsById (#7466)

* Add ExtensionsManager.lookupExtensionSettings

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

* Small change to name

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

* Add to CHANGELOG

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

* Move extensionSettingsMap.put

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

* Re-run CI

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

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit 16555e4)

* Add import Optional

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

* Remove merge conflicts

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

---------

Signed-off-by: Craig Perkins <[email protected]>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…t#7466)

* Add ExtensionsManager.lookupExtensionSettings

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

* Small change to name

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

* Add to CHANGELOG

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

* Move extensionSettingsMap.put

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

* Re-run CI

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

---------

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Extensions handshake is failing with TLS after change to utilize lookupInitializedExtensionById
5 participants