Skip to content

Commit

Permalink
fix Object Disks path parsing from config, remove unnecessary "/"
Browse files Browse the repository at this point in the history
  • Loading branch information
Slach committed Nov 27, 2023
1 parent 53893c1 commit fd34cf2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v2.4.8
BUG FIXES
- fix Object Disks path parsing from config, remove unnecessary "/"

# v2.4.7
BUG FIXES
- `--partitions=(v1,'v2')` could calculate wrong partition expression if system.columns will return fields in different order than they described in PARTITION BY clause, fix [791](https://github.com/Altinity/clickhouse-backup/issues/791)
Expand Down
4 changes: 2 additions & 2 deletions pkg/storage/object_disk/object_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ func makeObjectDiskConnection(ctx context.Context, ch *clickhouse.ClickHouse, cf
if len(hostParts) >= 3 {
s3cfg.Region = hostParts[2]
}
s3cfg.Path = s3URL.Path
s3cfg.Path = strings.Trim(s3URL.Path, "/")
s3cfg.ForcePathStyle = false
} else {
pathItems := strings.Split(strings.Trim(s3URL.Path, "/"), "/")
Expand Down Expand Up @@ -503,7 +503,7 @@ func makeObjectDiskConnection(ctx context.Context, ch *clickhouse.ClickHouse, cf
azureCfg.AccountName = creds.AzureAccountName
}
if azureURL.Path != "" {
azureCfg.Path = azureURL.Path
azureCfg.Path = strings.Trim(azureURL.Path, "/")
if azureCfg.AccountName != "" && strings.HasPrefix(azureCfg.Path, "/"+creds.AzureAccountName) {
azureCfg.Path = strings.TrimPrefix(azureURL.Path, "/"+creds.AzureAccountName)
}
Expand Down

0 comments on commit fd34cf2

Please sign in to comment.