mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-01-15 17:21:46 +01:00
Refactor s3 backend and suppress checksum warning
This commit is contained in:
@@ -15,6 +15,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
|
"slices"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -115,6 +116,7 @@ func (s3a *S3Archive) Init(rawConfig json.RawMessage) (uint64, error) {
|
|||||||
|
|
||||||
// Create S3 client with path-style option and custom endpoint if specified
|
// Create S3 client with path-style option and custom endpoint if specified
|
||||||
s3a.client = s3.NewFromConfig(awsCfg, func(o *s3.Options) {
|
s3a.client = s3.NewFromConfig(awsCfg, func(o *s3.Options) {
|
||||||
|
o.DisableLogOutputChecksumValidationSkipped = true
|
||||||
o.UsePathStyle = cfg.UsePathStyle
|
o.UsePathStyle = cfg.UsePathStyle
|
||||||
if cfg.Endpoint != "" {
|
if cfg.Endpoint != "" {
|
||||||
o.BaseEndpoint = aws.String(cfg.Endpoint)
|
o.BaseEndpoint = aws.String(cfg.Endpoint)
|
||||||
@@ -911,13 +913,7 @@ func (s3a *S3Archive) StoreClusterCfg(name string, config *schema.Cluster) error
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update clusters list if new
|
// Update clusters list if new
|
||||||
found := false
|
found := slices.Contains(s3a.clusters, name)
|
||||||
for _, c := range s3a.clusters {
|
|
||||||
if c == name {
|
|
||||||
found = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !found {
|
if !found {
|
||||||
s3a.clusters = append(s3a.clusters, name)
|
s3a.clusters = append(s3a.clusters, name)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user