Skip to content

Commit

Permalink
Merge f437061 into 5a3c33d
Browse files Browse the repository at this point in the history
  • Loading branch information
rm3l authored Aug 28, 2023
2 parents 5a3c33d + f437061 commit 30b1e8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/apiserver-impl/starterserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ func StartServer(
router.PathPrefix("/").Handler(staticServer)
}

addr := "127.0.0.1"
if port == 0 && !randomPort {
port, err = util.NextFreePort(20000, 30001, nil, "")
port, err = util.NextFreePort(20000, 30001, nil, addr)
if err != nil {
klog.V(0).Infof("Unable to start the API server; encountered error: %v", err)
cancelFunc()
}
}

listener, err := net.Listen("tcp", fmt.Sprintf(":%d", port))
listener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", addr, port))
if err != nil {
return ApiServer{}, fmt.Errorf("unable to start API Server listener on port %d: %w", port, err)
}
Expand Down

0 comments on commit 30b1e8b

Please sign in to comment.