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

Opensearch repository-s3 plugin cannot read ServiceAccount token #6390

Merged
merged 2 commits into from
Feb 21, 2023

Conversation

reta
Copy link
Collaborator

@reta reta commented Feb 20, 2023

Description

Allow to specify the identity web token file relatively to the config folder location (configured by OPENSEARCH_PATH_CONFIG so it would be possible to use soft links to access it):

ln -s $AWS_WEB_IDENTITY_TOKEN_FILE "${OPENSEARCH_PATH_CONFIG}/aws-web-identity-token-file"

And refer to it in opensearch.yml:

s3.client.default.identity_token_file: aws-web-identity-token-file

Issues Resolved

Closes #6312

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.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2023

Codecov Report

Merging #6390 (652a7da) into main (267e162) will increase coverage by 0.10%.
The diff coverage is 70.58%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff              @@
##               main    #6390      +/-   ##
============================================
+ Coverage     70.71%   70.81%   +0.10%     
- Complexity    59012    59115     +103     
============================================
  Files          4802     4802              
  Lines        282489   282495       +6     
  Branches      40726    40728       +2     
============================================
+ Hits         199759   200054     +295     
+ Misses        66376    66050     -326     
- Partials      16354    16391      +37     
Impacted Files Coverage Δ
...opensearch/repositories/s3/S3RepositoryPlugin.java 26.92% <0.00%> (-1.08%) ⬇️
...g/opensearch/repositories/s3/S3ClientSettings.java 77.10% <100.00%> (+0.43%) ⬆️
...java/org/opensearch/repositories/s3/S3Service.java 81.59% <100.00%> (+0.11%) ⬆️
...search/indices/recovery/RecoveryTargetHandler.java 0.00% <0.00%> (-100.00%) ⬇️
...ch/transport/ReceiveTimeoutTransportException.java 50.00% <0.00%> (-50.00%) ⬇️
...cluster/coordination/PublishClusterStateStats.java 33.33% <0.00%> (-37.51%) ⬇️
...java/org/opensearch/threadpool/ThreadPoolInfo.java 56.25% <0.00%> (-37.50%) ⬇️
...ndex/seqno/RetentionLeaseBackgroundSyncAction.java 37.50% <0.00%> (-37.50%) ⬇️
...ain/java/org/opensearch/search/sort/MinAndMax.java 63.15% <0.00%> (-36.85%) ⬇️
...ion/admin/cluster/node/info/PluginsAndModules.java 53.12% <0.00%> (-34.38%) ⬇️
... and 469 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta
Copy link
Collaborator Author

reta commented Feb 21, 2023

@andrross @dblock mind to take a look guys so we could get it into 2.6.0? thank you!

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

public S3RepositoryPlugin(final Settings settings) {
this(settings, new S3Service());
public S3RepositoryPlugin(final Settings settings, final Path configPath) {
Copy link
Member

Choose a reason for hiding this comment

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

If anyone else reading this is wondering how we can change a public constructor without changing any calling code, the answer is that the PluginsService expects one of three different constructor signatures and this one of them.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta reta merged commit 5560ba4 into opensearch-project:main Feb 21, 2023
@reta reta added the backport 2.x Backport to 2.x branch label Feb 21, 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-6390-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5560ba46c6a948ee34b64bc52929026b1cc65723
# Push it to GitHub
git push --set-upstream origin backport/backport-6390-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-6390-to-2.x.

reta added a commit to reta/OpenSearch that referenced this pull request Feb 21, 2023
…nsearch-project#6390)

* Opensearch repository-s3 plugin cannot read ServiceAccount token

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Address code review comments

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

---------

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 5560ba4)
reta added a commit that referenced this pull request Feb 21, 2023
…) (#6423)

* Opensearch repository-s3 plugin cannot read ServiceAccount token

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

* Address code review comments

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>

---------

Signed-off-by: Andriy Redko <andriy.redko@aiven.io>
(cherry picked from commit 5560ba4)
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] Opensearch repository-s3 plugin cannot read ServiceAccount token
4 participants