Skip to content
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

cmd: server should use default addr if none is specified #420

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion cmd/kes/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,23 @@ func startServer(addrFlag, configFlag string) error {
return err
}

// Read the config file before looking up the
// local network interfaces. We may not know the
// server addr yet since a user may not specified
// one on the command line.
rawConfig, err := kesconf.ReadFile(configFlag)
if err != nil {
return err
}
if addrFlag == "" {
switch {
case addrFlag != "":
// Nothing to do, addrFlag is set
case rawConfig.Addr != "":
addrFlag = rawConfig.Addr
default:
addrFlag = "0.0.0.0:7373"
}

host, port, err := net.SplitHostPort(addrFlag)
if err != nil {
return err
Expand Down
Loading