cmd/ctrld: ensure viper is re-new in --cd mode

This commit is contained in:
Cuong Manh Le
2023-01-10 18:56:06 +07:00
committed by Cuong Manh Le
parent 279e938b2a
commit 3a5c71514c
2 changed files with 2 additions and 1 deletions

View File

@@ -449,6 +449,7 @@ func processCDFlags() {
},
}
v = viper.NewWithOptions(viper.KeyDelimiter("::"))
v.Set("network", cfg.Network)
v.Set("upstream", cfg.Upstream)
v.Set("listener", cfg.Listener)

View File

@@ -60,7 +60,7 @@ func initLogging() {
fmt.Fprintf(os.Stderr, "failed to create log path: %v", err)
os.Exit(1)
}
logFile, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0600)
logFile, err := os.OpenFile(logFilePath, os.O_APPEND|os.O_CREATE|os.O_RDWR, os.FileMode(0o600))
if err != nil {
fmt.Fprintf(os.Stderr, "failed to create log file: %v", err)
os.Exit(1)