sync the change from kubeedge in 2.20
Signed-off-by: wbc6080 <wangbincheng4@huawei.com>
This commit is contained in:
parent
d886275726
commit
26e3ec2e41
|
@ -43,7 +43,7 @@ func main() {
|
|||
go panel.DevStart()
|
||||
|
||||
// start http server
|
||||
httpServer := httpserver.NewRestServer(panel)
|
||||
httpServer := httpserver.NewRestServer(panel, c.Common.HTTPPort)
|
||||
go httpServer.StartServer()
|
||||
|
||||
// start grpc server
|
||||
|
|
|
@ -44,6 +44,7 @@ type Common struct {
|
|||
Protocol string `yaml:"protocol"`
|
||||
Address string `yaml:"address"`
|
||||
EdgeCoreSock string `yaml:"edgecore_sock"`
|
||||
HTTPPort string `yaml:"http_port"`
|
||||
}
|
||||
|
||||
// Parse the configuration file. If failed, return error.
|
||||
|
|
|
@ -30,10 +30,14 @@ type RestServer struct {
|
|||
|
||||
type Option func(server *RestServer)
|
||||
|
||||
func NewRestServer(devPanel global.DevPanel, options ...Option) *RestServer {
|
||||
func NewRestServer(devPanel global.DevPanel, httpPort string, options ...Option) *RestServer {
|
||||
if httpPort == "" {
|
||||
httpPort = "7777"
|
||||
}
|
||||
|
||||
rest := &RestServer{
|
||||
IP: "0.0.0.0",
|
||||
Port: "7777",
|
||||
Port: httpPort,
|
||||
Router: mux.NewRouter(),
|
||||
WriteTimeout: 10 * time.Second,
|
||||
ReadTimeout: 10 * time.Second,
|
||||
|
|
Loading…
Reference in New Issue