diff --git a/pkg/archive/fsBackend.go b/pkg/archive/fsBackend.go index cde9a11..63b1708 100644 --- a/pkg/archive/fsBackend.go +++ b/pkg/archive/fsBackend.go @@ -515,7 +515,6 @@ func (fsa *FsArchive) Iter(loadMetricData bool) <-chan JobContainer { cclog.Errorf("in %s: %s", filepath.Join(dirpath, startTimeDir.Name()), err.Error()) } ch <- JobContainer{Meta: job, Data: &data} - cclog.Errorf("in %s: %s", filepath.Join(dirpath, startTimeDir.Name()), err.Error()) } else { ch <- JobContainer{Meta: job, Data: nil} } diff --git a/pkg/archive/s3Backend.go b/pkg/archive/s3Backend.go index 23e94e2..c974899 100644 --- a/pkg/archive/s3Backend.go +++ b/pkg/archive/s3Backend.go @@ -90,17 +90,6 @@ func (s3a *S3Archive) Init(rawConfig json.RawMessage) (uint64, error) { if cfg.AccessKey != "" && cfg.SecretKey != "" { // Use static credentials - customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) { - if cfg.Endpoint != "" { - return aws.Endpoint{ - URL: cfg.Endpoint, - HostnameImmutable: cfg.UsePathStyle, - Source: aws.EndpointSourceCustom, - }, nil - } - return aws.Endpoint{}, &aws.EndpointNotFoundError{} - }) - awsCfg, err = awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(cfg.Region), awsconfig.WithCredentialsProvider(credentials.NewStaticCredentialsProvider( @@ -108,7 +97,6 @@ func (s3a *S3Archive) Init(rawConfig json.RawMessage) (uint64, error) { cfg.SecretKey, "", )), - awsconfig.WithEndpointResolverWithOptions(customResolver), ) } else { // Use default credential chain @@ -122,9 +110,12 @@ func (s3a *S3Archive) Init(rawConfig json.RawMessage) (uint64, error) { return 0, err } - // Create S3 client with path-style option + // Create S3 client with path-style option and custom endpoint if specified s3a.client = s3.NewFromConfig(awsCfg, func(o *s3.Options) { o.UsePathStyle = cfg.UsePathStyle + if cfg.Endpoint != "" { + o.BaseEndpoint = aws.String(cfg.Endpoint) + } }) s3a.bucket = cfg.Bucket