-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embed: return error when advertise-client-urls are with empty hosts #8786
Conversation
embed/config.go
Outdated
@@ -343,6 +343,7 @@ func (cfg *Config) Validate() error { | |||
addrs[i] = cfg.ACUrls[i].String() | |||
} | |||
plog.Warningf("advertise-client-urls %q is deprecated (%v)", strings.Join(addrs, ","), err) | |||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harryge00 Can we remove the line 340 as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also make it as an error value
return fmt.Errorf("advertise-client-urls %q is deprecated (%v)", strings.Join(addrs, ","), err)
It will be logged when etcd exits anyway
not sure how this solves the empty host issue. |
oh. ok. i see. we are returning the error from checkhost now. |
embed/config.go
Outdated
@@ -343,6 +343,7 @@ func (cfg *Config) Validate() error { | |||
addrs[i] = cfg.ACUrls[i].String() | |||
} | |||
plog.Warningf("advertise-client-urls %q is deprecated (%v)", strings.Join(addrs, ","), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the warning? or change it to errorf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same at line 337.
@harryge00 can you help to resolve the comments? so that we can get this patch merged in? |
4a8def7
to
fab17fc
Compare
embed/config.go
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now only --initial-advertise-peer-urls
available ?
Have you tried this branch with |
embed/config.go
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf(`--initial-advertise-peer-urls %q must be "host:port" (%v)`, strings.Join(addrs, ","), err)
embed/config.go
Outdated
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return fmt.Errorf(`--advertise-client-urls %q must be "host:port" (%v)`, strings.Join(addrs, ","), err)
…eer-urls are with empty hosts
fab17fc
to
6912a8e
Compare
Yes @gyuho
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. thanks!
solves #8379
Not sure if this is what wanted. 😅