Skip to content

Commit

Permalink
embed: return error when advertise-client-urls or initial-advertise-p…
Browse files Browse the repository at this point in the history
…eer-urls are with empty hosts
  • Loading branch information
harryge00 committed Jan 25, 2018
1 parent 37f577c commit fab17fc
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions embed/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,22 +399,19 @@ func (cfg *Config) Validate() error {
return err
}
if err := checkHostURLs(cfg.APUrls); err != nil {
// TODO: return err in v3.4
addrs := make([]string, len(cfg.APUrls))
for i := range cfg.APUrls {
addrs[i] = cfg.APUrls[i].String()
}
plog.Warningf("advertise-peer-urls %q is deprecated (%v)", strings.Join(addrs, ","), err)
return fmt.Errorf("advertise-peer-urls %q is deprecated (%v)", strings.Join(addrs, ","), err)
}
if err := checkHostURLs(cfg.ACUrls); err != nil {
// TODO: return err in v3.4
addrs := make([]string, len(cfg.ACUrls))
for i := range cfg.ACUrls {
addrs[i] = cfg.ACUrls[i].String()
}
plog.Warningf("advertise-client-urls %q is deprecated (%v)", strings.Join(addrs, ","), err)
return fmt.Errorf("advertise-client-urls %q is deprecated (%v)", strings.Join(addrs, ","), err)
}

// Check if conflicting flags are passed.
nSet := 0
for _, v := range []bool{cfg.Durl != "", cfg.InitialCluster != "", cfg.DNSCluster != ""} {
Expand Down

0 comments on commit fab17fc

Please sign in to comment.