Copy scripts from tools to bin/ directory in assembly and make scripts agnostic to directory#6023
Copy scripts from tools to bin/ directory in assembly and make scripts agnostic to directory#6023cwperks wants to merge 10 commits intoopensearch-project:mainfrom
Conversation
…s agnostic to directory Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6023 +/- ##
==========================================
- Coverage 74.80% 74.78% -0.02%
==========================================
Files 447 447
Lines 28463 28474 +11
Branches 4328 4330 +2
==========================================
+ Hits 21291 21295 +4
- Misses 5176 5184 +8
+ Partials 1996 1995 -1
🚀 New features to boost your workflow:
|
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Description
This PR fixes the packaging of the OpenSearch Security tools scripts so they retain executable permissions after plugin installation.
Today, scripts under
<OPENSEARCH_HOME>/plugins/opensearch-security/toolscan lose their execute bit during plugin installation. As a result, cluster administrators must manually update file permissions before they can run them.i.e.
With the changes in this PR we are going to copy the tools into another directory called
bin/on assembly which OpenSearch core nows how to handle on plugin install to copy these to<OPENSEARCH_HOME>/bin/opensearch-security/and keep the file's permissions as they are (755).In order to do this, I also have to make the scripts agnostic to directory since they are now one level less deep so there's logic introduced to identify OPENSEARCH_HOME directory by looking for the lib directory and OpenSearch jar.
Yes this means there will be copies of each script (left intentionally until all places around the ecosystem are updated like Docker entrypoint).
Issues Resolved
Enhancement
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.