diff --git a/etcdmain/config_test.go b/etcdmain/config_test.go index c83de1f142f..db391e7efce 100644 --- a/etcdmain/config_test.go +++ b/etcdmain/config_test.go @@ -15,6 +15,7 @@ package etcdmain import ( + "flag" "fmt" "io/ioutil" "net/url" @@ -24,6 +25,7 @@ import ( "testing" "go.etcd.io/etcd/embed" + "go.etcd.io/etcd/pkg/flags" "sigs.k8s.io/yaml" ) @@ -496,6 +498,21 @@ func TestConfigFileElectionTimeout(t *testing.T) { } } +func TestFlagsPresentInHelp(t *testing.T) { + cfg := newConfig() + cfg.cf.flagSet.VisitAll(func(f *flag.Flag) { + if _, ok := f.Value.(*flags.IgnoredFlag); ok { + // Ignored flags do not need to be in the help + return + } + + flagText := fmt.Sprintf("--%s", f.Name) + if !strings.Contains(flagsline, flagText) && !strings.Contains(usageline, flagText) { + t.Errorf("Neither flagsline nor usageline in help.go contains flag named %s", flagText) + } + }) +} + func mustCreateCfgFile(t *testing.T, b []byte) *os.File { tmpfile, err := ioutil.TempFile("", "servercfg") if err != nil { diff --git a/etcdmain/help.go b/etcdmain/help.go index c2945b84c01..5f4769c4d8f 100644 --- a/etcdmain/help.go +++ b/etcdmain/help.go @@ -85,6 +85,8 @@ Member: Minimum duration interval that a client should wait before pinging server. --grpc-keepalive-interval '2h' Frequency duration of server-to-client ping to check if a connection is alive (0 to disable). + --enable-grpc-gateway + Enable GRPC gateway. --grpc-keepalive-timeout '20s' Additional duration of wait before closing a non-responsive connection (0 to disable). @@ -229,6 +231,8 @@ Experimental feature: Unsafe feature: --force-new-cluster 'false' Force to create a new one-member cluster. + --unsafe-no-fsync 'false' + Disables fsync, unsafe, will cause data loss. CAUTIOUS with unsafe flag! It may break the guarantees given by the consensus protocol!