Skip to content

Commit 6fd2dfd

Browse files
committed
etcdmain: fix that advertise-client-urls is required in proxy mode
etcd proxy doesn't need to set advertise-client-urls because the flag is not used.
1 parent 896ce16 commit 6fd2dfd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

etcdmain/config.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,12 @@ func (cfg *config) Parse(arguments []string) error {
258258
if err != nil {
259259
return err
260260
}
261-
if flags.IsSet(cfg.FlagSet, "listen-client-urls") && !flags.IsSet(cfg.FlagSet, "advertise-client-urls") {
262-
return errUnsetAdvertiseClientURLsFlag
261+
262+
// when etcd runs in member mode user needs to set -advertise-client-urls if -listen-client-urls is set.
263+
if cfg.proxy.String() != proxyFlagOn {
264+
if flags.IsSet(cfg.FlagSet, "listen-client-urls") && !flags.IsSet(cfg.FlagSet, "advertise-client-urls") {
265+
return errUnsetAdvertiseClientURLsFlag
266+
}
263267
}
264268

265269
if 5*cfg.TickMs > cfg.ElectionMs {

0 commit comments

Comments
 (0)