chore: Copy `aws.ConfigFromURL` function from `grafana/dskit` (#16777)

`dskit` is about to upgrade the AWS client SDK from v1 to v2 and the only thing that blocks them is the `ConfigFromURL` function.

Since Loki uses the function for their deprecated legacy AWS clients, we move the function into the Loki code base for the time being.

---
Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
pull/16779/head
Christian Haudum 10 months ago committed by GitHub
parent e3fb4c643b
commit 9ae34e68a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 0
      pkg/storage/chunk/client/aws/config.go
  2. 3
      pkg/storage/chunk/client/aws/dynamodb_storage_client.go
  3. 5
      pkg/storage/chunk/client/aws/s3_storage_client.go
  4. 1
      vendor/modules.txt

@ -18,7 +18,6 @@ import (
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
"github.com/go-kit/log/level"
awscommon "github.com/grafana/dskit/aws"
"github.com/grafana/dskit/backoff"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/instrument"
@ -802,7 +801,7 @@ func awsSessionFromURL(awsURL *url.URL) (client.ConfigProvider, error) {
if len(path) > 0 {
level.Warn(log.Logger).Log("msg", "ignoring DynamoDB URL path", "path", path)
}
config, err := awscommon.ConfigFromURL(awsURL)
config, err := ConfigFromURL(awsURL)
if err != nil {
return nil, err
}

@ -20,14 +20,11 @@ import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3iface"
awscommon "github.com/grafana/dskit/aws"
"github.com/grafana/dskit/backoff"
"github.com/grafana/dskit/flagext"
"github.com/grafana/dskit/instrument"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
amnet "k8s.io/apimachinery/pkg/util/net"
bucket_s3 "github.com/grafana/loki/v3/pkg/storage/bucket/s3"
@ -194,7 +191,7 @@ func buildS3Client(cfg S3Config, hedgingCfg hedging.Config, hedging bool) (*s3.S
// if an s3 url is passed use it to initialize the s3Config and then override with any additional params
if cfg.S3.URL != nil {
s3Config, err = awscommon.ConfigFromURL(cfg.S3.URL)
s3Config, err = ConfigFromURL(cfg.S3.URL)
if err != nil {
return nil, err
}

@ -1054,7 +1054,6 @@ github.com/grafana/ckit/shard
github.com/grafana/cloudflare-go
# github.com/grafana/dskit v0.0.0-20241007172036-53283a0f6b41
## explicit; go 1.21
github.com/grafana/dskit/aws
github.com/grafana/dskit/backoff
github.com/grafana/dskit/cancellation
github.com/grafana/dskit/concurrency

Loading…
Cancel
Save