Show default config values instead of active ones in sensu-backend help
@@ -103,7 +103,12 @@ func newStartCommand() *cobra.Command {
insecureSkipTLSVerify := viper.GetBool(flagInsecureSkipTLSVerify)
if certFile != "" && keyFile != "" && trustedCAFile != "" {
- cfg.TLS = &types.TLSOptions{certFile, keyFile, trustedCAFile, insecureSkipTLSVerify}
+ cfg.TLS = &types.TLSOptions{
+ CertFile: certFile,
+ KeyFile: keyFile,
+ TrustedCAFile: trustedCAFile,
+ InsecureSkipVerify: insecureSkipTLSVerify,
+ }
} else if certFile != "" || keyFile != "" || trustedCAFile != "" {
emptyFlags := []string{}
if certFile == "" {
@@ -152,15 +157,6 @@ func newStartCommand() *cobra.Command {
configFilePath = filepath.Join(path.SystemConfigDir(), "backend.yml")
}
- // Configure location of backend configuration
- viper.SetConfigType("yaml")
- viper.SetConfigFile(configFilePath)
-
- // Only error out if flagConfigFile is used
- if err := viper.ReadInConfig(); err != nil && configFile != "" {
- setupErr = err
- }
-
// Flag defaults
viper.SetDefault(flagAgentHost, "[::]")
viper.SetDefault(flagAgentPort, 8081)
@@ -212,5 +208,14 @@ func newStartCommand() *cobra.Command {
cmd.Flags().String(flagStoreInitialClusterToken, viper.GetString(flagStoreInitialClusterToken), "store initial cluster token")
cmd.Flags().String(flagStoreNodeName, viper.GetString(flagStoreNodeName), "store cluster member node name")
+ // Configure location of backend configuration
+ viper.SetConfigType("yaml")
+ viper.SetConfigFile(configFilePath)
+
+ // Only error out if flagConfigFile is used
+ if err := viper.ReadInConfig(); err != nil && configFile != "" {
+ setupErr = err
+ }
+
return cmd
}
