Browse Source

*: more clarification on server config file

Be more explicit in document and command line usage message that if a
config file is provided, other command line flags and environment
variables will be ignored.
Jingyi Hu 6 years ago
parent
commit
5e9c424f1f
3 changed files with 4 additions and 4 deletions
  1. 2 2
      Documentation/op-guide/configuration.md
  2. 1 1
      etcdmain/config.go
  3. 1 1
      etcdmain/help.go

+ 2 - 2
Documentation/op-guide/configuration.md

@@ -4,7 +4,7 @@ title: Configuration flags
 
 
 etcd is configurable through a configuration file, various command-line flags, and environment variables.
 etcd is configurable through a configuration file, various command-line flags, and environment variables.
 
 
-A reusable configuration file is a YAML file made with name and value of one or more command-line flags described below. In order to use this file, specify the file path as a value to the `--config-file` flag. The [sample configuration file][sample-config-file] can be used as a starting point to create a new configuration file as needed.
+A reusable configuration file is a YAML file made with name and value of one or more command-line flags described below. In order to use this file, specify the file path as a value to the `--config-file` flag or `ETCD_CONFIG_FILE` environment variable. The [sample configuration file][sample-config-file] can be used as a starting point to create a new configuration file as needed.
 
 
 Options set on the command line take precedence over those from the environment. If a configuration file is provided, other command line flags and environment variables will be ignored.
 Options set on the command line take precedence over those from the environment. If a configuration file is provided, other command line flags and environment variables will be ignored.
 For example, `etcd --config-file etcd.conf.yml.sample --data-dir /tmp` will ignore the `--data-dir` flag.
 For example, `etcd --config-file etcd.conf.yml.sample --data-dir /tmp` will ignore the `--data-dir` flag.
@@ -372,7 +372,7 @@ Follow the instructions when using these flags.
 + default: false
 + default: false
 
 
 ### --config-file
 ### --config-file
-+ Load server configuration from a file.
++ Load server configuration from a file. Note that if a configuration file is provided, other command line flags and environment variables will be ignored.
 + default: ""
 + default: ""
 + example: [sample configuration file][sample-config-file]
 + example: [sample configuration file][sample-config-file]
 + env variable: ETCD_CONFIG_FILE
 + env variable: ETCD_CONFIG_FILE

+ 1 - 1
etcdmain/config.go

@@ -127,7 +127,7 @@ func newConfig() *config {
 		fmt.Fprintln(os.Stderr, usageline)
 		fmt.Fprintln(os.Stderr, usageline)
 	}
 	}
 
 
-	fs.StringVar(&cfg.configFile, "config-file", "", "Path to the server configuration file")
+	fs.StringVar(&cfg.configFile, "config-file", "", "Path to the server configuration file. Note that if a configuration file is provided, other command line flags and environment variables will be ignored.")
 
 
 	// member
 	// member
 	fs.StringVar(&cfg.ec.Dir, "data-dir", cfg.ec.Dir, "Path to the data directory.")
 	fs.StringVar(&cfg.ec.Dir, "data-dir", cfg.ec.Dir, "Path to the data directory.")

+ 1 - 1
etcdmain/help.go

@@ -35,7 +35,7 @@ var (
     Show the help information about etcd.
     Show the help information about etcd.
 
 
   etcd --config-file
   etcd --config-file
-    Path to the server configuration file.
+    Path to the server configuration file. Note that if a configuration file is provided, other command line flags and environment variables will be ignored.
 
 
   etcd gateway
   etcd gateway
     Run the stateless pass-through etcd TCP connection forwarding proxy.
     Run the stateless pass-through etcd TCP connection forwarding proxy.