From 8fd18cc0c16766701666f2aa6330f71c81a46147 Mon Sep 17 00:00:00 2001 From: Vadim Voitenko Date: Wed, 27 Mar 2024 18:38:03 +0200 Subject: [PATCH] Fixed s3 region env variable providing Fixed region value provided via environment variable `AWS_REGION` for s3 storage Found when investigated #36 --- internal/storages/s3/s3.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/storages/s3/s3.go b/internal/storages/s3/s3.go index 091eb9fd..3a19cfa0 100644 --- a/internal/storages/s3/s3.go +++ b/internal/storages/s3/s3.go @@ -125,7 +125,10 @@ func NewStorage(ctx context.Context, cfg *Config, logLevel string) (*Storage, er if cfg.Endpoint != "" { awsCfg.WithEndpoint(cfg.Endpoint) } - awsCfg.WithRegion(cfg.Region) + + if cfg.Region != "" { + awsCfg.WithRegion(cfg.Region) + } if cfg.CertFile != "" { file, err := os.Open(cfg.CertFile)