Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

tidb-lightning-ctl: change default of -d to 'noop://' #453

Merged
merged 2 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/tidb-lightning-ctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ func run() error {
)

globalCfg := config.Must(config.LoadGlobalConfig(os.Args[1:], func(fs *flag.FlagSet) {
// change the default of `-d` from empty to 'noop://'.
// there is a check if `-d` points to a valid storage, and '' is not.
// since tidb-lightning-ctl does not need `-d` we change the default to a valid but harmless value.
dFlag := fs.Lookup("d")
dFlag.Value.Set("noop://")
dFlag.DefValue = "noop://"

compact = fs.Bool("compact", false, "do manual compaction on the target cluster")
mode = fs.String("switch-mode", "", "switch tikv into import mode or normal mode, values can be ['import', 'normal']")
flagFetchMode = fs.Bool("fetch-mode", false, "obtain the current mode of every tikv in the cluster")
Expand Down
2 changes: 1 addition & 1 deletion lightning/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const (

var (
defaultConfigPaths = []string{"tidb-lightning.toml", "conf/tidb-lightning.toml"}
supportedStorageTypes = []string{"file", "local", "s3"}
supportedStorageTypes = []string{"file", "local", "s3", "noop"}
)

type DBStore struct {
Expand Down