elastic / cloud-sdk-go

Apache License 2.0
21 stars 46 forks source link

snaprepoapi: Add PathStyleAccess field to S3Config #426

Closed pascal-hofmann closed 1 year ago

pascal-hofmann commented 1 year ago

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

Readiness Checklist

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 commented 1 year ago

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 commented 1 year ago

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

pascal-hofmann commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

💚 All backports created successfully

Status Branch Result
1.12

Questions ?

Please refer to the Backport tool documentation