From 909928e641e500a729a6e1be72b3a06c472b8a6c Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Thu, 14 Dec 2023 16:40:36 +0100 Subject: [PATCH] fix CI, replace deprecated S3 API Signed-off-by: Nicola Murino --- .github/workflows/development.yml | 2 +- internal/vfs/s3fs.go | 16 +++------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index da13c088..64d6a962 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -298,7 +298,7 @@ jobs: MYSQL_USER: sftpgo MYSQL_PASSWORD: sftpgo options: >- - --health-cmd "mysqladmin status -h 127.0.0.1 -P 3306 -u root -p$MYSQL_ROOT_PASSWORD" + --health-cmd "mariadb-admin status -h 127.0.0.1 -P 3306 -u root -p$MYSQL_ROOT_PASSWORD" --health-interval 10s --health-timeout 5s --health-retries 6 diff --git a/internal/vfs/s3fs.go b/internal/vfs/s3fs.go index f6b58eec..1f5d7151 100644 --- a/internal/vfs/s3fs.go +++ b/internal/vfs/s3fs.go @@ -115,19 +115,6 @@ func NewS3Fs(connectionID, localTempDir, mountPath string, s3Config S3FsConfig) awsConfig.Credentials = aws.NewCredentialsCache( credentials.NewStaticCredentialsProvider(fs.config.AccessKey, fs.config.AccessSecret.GetPayload(), "")) } - if fs.config.Endpoint != "" { - endpointResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...any) (aws.Endpoint, error) { - return aws.Endpoint{ - URL: fs.config.Endpoint, - HostnameImmutable: fs.config.ForcePathStyle, - PartitionID: "aws", - SigningRegion: fs.config.Region, - Source: aws.EndpointSourceCustom, - }, nil - }) - awsConfig.EndpointResolverWithOptions = endpointResolver - } - fs.setConfigDefaults() if fs.config.RoleARN != "" { @@ -137,6 +124,9 @@ func NewS3Fs(connectionID, localTempDir, mountPath string, s3Config S3FsConfig) } fs.svc = s3.NewFromConfig(awsConfig, func(o *s3.Options) { o.UsePathStyle = fs.config.ForcePathStyle + if fs.config.Endpoint != "" { + o.BaseEndpoint = aws.String(fs.config.Endpoint) + } }) return fs, nil }