Skip to content

snaprepoapi: Add PathStyleAccess field to S3Config #426

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

Merged

Conversation

pascal-hofmann
Copy link
Contributor

@pascal-hofmann pascal-hofmann commented Mar 29, 2023

Description

Add the missing PathStyleAccess field to the struct S3Config which is used for configuring S3 snapshot repositories.
See also https://www.elastic.co/guide/en/elasticsearch/reference/current/repository-s3.html#repository-s3-client

Also updates the outdated link to the Elasticsearch official documentation.

Related Issues

#425

Motivation and Context

This allows creating S3 snapshot repositories that talk to S3 backends which require path style access.

How Has This Been Tested?

Ran unit tests and tested against the ECE API.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (improves code quality but has no user-facing effect)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Readiness Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Note: I have issues with make format and make lint. I think this happens because bin/golangci-lint is very old.

WARN [runner] Can't run linter goanalysis_metalinter: S1031: failed prerequisites: [(inspect@github.com/elastic/cloud-sdk-go/pkg/multierror, isgenerated@github.com/elastic/cloud-sdk-go/pkg/multierror): analysis skipped: errors in package: [/Users/pascal/gec/cloud-sdk-go/pkg/multierror/format.go:21:2: could not import bytes (/usr/local/Cellar/go/1.20.2/libexec/src/bytes/buffer.go:10:2: could not import errors (/usr/local/Cellar/go/1.20.2/libexec/src/errors/wrap.go:8:2: could not import internal/reflectlite (/usr/local/Cellar/go/1.20.2/libexec/src/internal/reflectlite/swapper.go:8:2: could not import internal/goarch (-: could not load export data: cannot import "internal/goarch" (unknown bexport format version -1 …

@pascal-hofmann pascal-hofmann marked this pull request as ready for review March 29, 2023 05:52
@pascal-hofmann pascal-hofmann requested a review from a team as a code owner March 29, 2023 05:52
@pascal-hofmann
Copy link
Contributor Author

pascal-hofmann commented Mar 30, 2023

I just verified that this is working via a modified version of terraform-provider-ec that talks to our internal ECE instance.

@tobio, @gigerdo: Can you have a look at this? Would be great to get this merged/released quickly.

@gigerdo gigerdo requested a review from a team March 30, 2023 09:01
Copy link
Member

@gigerdo gigerdo left a comment

Choose a reason for hiding this comment

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

Thanks for opening the PR

LGTM 👍

I can probably put this into a quick v1.12.1 release.

@gigerdo
Copy link
Member

gigerdo commented Mar 30, 2023

To merge you need to sign your commits (https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)

Add the missing `PathStyleAccess` field to the struct `S3Config` which is
used for configuring S3 snapshot repositories.

Also updates the outdated link to the Elasticsearch official
documentation.
@pascal-hofmann pascal-hofmann force-pushed the feat/add-path-style-access-to-s3-config branch from bef0b4d to 04a9ffc Compare March 30, 2023 11:42
@pascal-hofmann
Copy link
Contributor Author

To merge you need to sign your commits (https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)

This is fixed now.

@gigerdo gigerdo merged commit 0254b2d into elastic:master Mar 30, 2023
@gigerdo
Copy link
Member

gigerdo commented Mar 30, 2023

Btw. regarding the lint issues: It is indeed due to the old versions used. It still works when using an older go version (1.16 for example). We will have to update the go version and libraries to more recent ones.

gigerdo pushed a commit to gigerdo/cloud-sdk-go that referenced this pull request Mar 30, 2023
Add the missing `PathStyleAccess` field to the struct `S3Config` which is
used for configuring S3 snapshot repositories.

Also updates the outdated link to the Elasticsearch official
documentation.

(cherry picked from commit 0254b2d)
@gigerdo
Copy link
Member

gigerdo commented Mar 30, 2023

💚 All backports created successfully

Status Branch Result
1.12

Questions ?

Please refer to the Backport tool documentation

gigerdo added a commit that referenced this pull request Mar 30, 2023
Add the missing `PathStyleAccess` field to the struct `S3Config` which is
used for configuring S3 snapshot repositories.

Also updates the outdated link to the Elasticsearch official
documentation.

(cherry picked from commit 0254b2d)

Co-authored-by: Pascal Hofmann <mail@pascalhofmann.de>
@pascal-hofmann pascal-hofmann deleted the feat/add-path-style-access-to-s3-config branch March 30, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants