Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support storage base path as prefix #27827

Merged
merged 5 commits into from
Nov 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix bug
  • Loading branch information
lunny committed Oct 29, 2023
commit bae41ca71c6be91ad0ef91b1c9d4f072d3d301af
7 changes: 5 additions & 2 deletions modules/setting/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,17 @@ func getStorageForMinio(targetSec, overrideSec ConfigSection, tp targetSecType,
return nil, fmt.Errorf("map minio config failed: %v", err)
}

defaultPath := name + "/"
var defaultPath string
if storage.MinioConfig.BasePath != "" {
if tp == targetSecIsStorage || tp == targetSecIsDefault {
defaultPath = strings.TrimSuffix(storage.MinioConfig.BasePath, "/") + "/" + defaultPath
defaultPath = strings.TrimSuffix(storage.MinioConfig.BasePath, "/") + "/" + name + "/"
} else {
defaultPath = storage.MinioConfig.BasePath
}
}
if defaultPath == "" {
defaultPath = name + "/"
}

if overrideSec != nil {
storage.MinioConfig.ServeDirect = ConfigSectionKeyBool(overrideSec, "SERVE_DIRECT", storage.MinioConfig.ServeDirect)
Expand Down