aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-06-25 17:54:56 -0700
committerchrislu <chris.lu@gmail.com>2025-06-25 17:54:56 -0700
commitab49540d2ba0f8c38324247360edd08bb9355b9b (patch)
treee25883e8f98d6bbe32bd3ef1410783319fe0bbb5
parent95261a712ee272e1924939d827d18df048f2c72e (diff)
downloadseaweedfs-ab49540d2ba0f8c38324247360edd08bb9355b9b.tar.xz
seaweedfs-ab49540d2ba0f8c38324247360edd08bb9355b9b.zip
use master.toml value if not empty
fix https://github.com/seaweedfs/seaweedfs/issues/6922
-rw-r--r--weed/command/master.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/weed/command/master.go b/weed/command/master.go
index c7b979e05..a8cdf76c6 100644
--- a/weed/command/master.go
+++ b/weed/command/master.go
@@ -3,13 +3,14 @@ package command
import (
"context"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/util/version"
"net/http"
"os"
"path"
"strings"
"time"
+ "github.com/seaweedfs/seaweedfs/weed/util/version"
+
hashicorpRaft "github.com/hashicorp/raft"
"slices"
@@ -111,6 +112,11 @@ func runMaster(cmd *Command, args []string) bool {
util.LoadSecurityConfiguration()
util.LoadConfiguration("master", false)
+ // bind viper configuration to command line flags
+ if v := util.GetViper().GetString("master.mdir"); v != "" {
+ *m.metaFolder = v
+ }
+
grace.SetupProfiling(*masterCpuProfile, *masterMemProfile)
parent, _ := util.FullPath(*m.metaFolder).DirAndName()