config: add some validations (#3610)

This commit is contained in:
fatedier
2023-09-13 18:59:51 +08:00
committed by GitHub
parent 7cd02f5bd8
commit 74255f711e
9 changed files with 144 additions and 20 deletions

View File

@@ -117,6 +117,7 @@ var rootCmd = &cobra.Command{
// Do not show command usage here.
err := runClient(cfgFile)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
return nil
@@ -199,7 +200,6 @@ func parseClientCommonCfgFromCmd() (*v1.ClientCommonConfig, error) {
func runClient(cfgFilePath string) error {
cfg, pxyCfgs, visitorCfgs, isLegacyFormat, err := config.LoadClientConfig(cfgFilePath)
if err != nil {
fmt.Println(err)
return err
}
if isLegacyFormat {