summaryrefslogtreecommitdiff
path: root/edgesite
diff options
context:
space:
mode:
authorvincentgoat <linguohui1@huawei.com>2022-06-25 17:21:07 +0800
committervincentgoat <linguohui1@huawei.com>2022-06-30 09:18:34 +0800
commitd1b08c84351eea8c9f0d2593e556896be5f21c3a (patch)
treeafce6759817df6e3d63923f3e7506a8d3ce991ab /edgesite
parentMerge pull request #3975 from vincentgoat/closefilehandle (diff)
downloadkubeedge-d1b08c84351eea8c9f0d2593e556896be5f21c3a.tar.gz
fix complex parameters
Signed-off-by: vincentgoat <linguohui1@huawei.com>
Diffstat (limited to 'edgesite')
-rw-r--r--edgesite/cmd/edgesite-server/app/server.go19
1 files changed, 5 insertions, 14 deletions
diff --git a/edgesite/cmd/edgesite-server/app/server.go b/edgesite/cmd/edgesite-server/app/server.go
index 3b8034cb8..d0e1acc63 100644
--- a/edgesite/cmd/edgesite-server/app/server.go
+++ b/edgesite/cmd/edgesite-server/app/server.go
@@ -105,15 +105,10 @@ func (p *Proxy) run(o *options.ProxyRunOptions) error {
return fmt.Errorf("failed to run the agent server: %v", err)
}
klog.V(1).Infoln("Starting admin server for debug connections.")
- err = p.runAdminServer(o, server)
- if err != nil {
- return fmt.Errorf("failed to run the admin server: %v", err)
- }
+ p.runAdminServer(o)
+
klog.V(1).Infoln("Starting health server for healthchecks.")
- err = p.runHealthServer(o, server)
- if err != nil {
- return fmt.Errorf("failed to run the health server: %v", err)
- }
+ p.runHealthServer(o, server)
stopCh := SetupSignalHandler()
<-stopCh
@@ -326,7 +321,7 @@ func (p *Proxy) runAgentServer(o *options.ProxyRunOptions, server *server.ProxyS
return nil
}
-func (p *Proxy) runAdminServer(o *options.ProxyRunOptions, server *server.ProxyServer) error {
+func (p *Proxy) runAdminServer(o *options.ProxyRunOptions) {
muxHandler := http.NewServeMux()
muxHandler.Handle("/metrics", promhttp.Handler())
if o.EnableProfiling {
@@ -349,11 +344,9 @@ func (p *Proxy) runAdminServer(o *options.ProxyRunOptions, server *server.ProxyS
}
klog.V(1).Infoln("Admin server stopped listening")
}()
-
- return nil
}
-func (p *Proxy) runHealthServer(o *options.ProxyRunOptions, server *server.ProxyServer) error {
+func (p *Proxy) runHealthServer(o *options.ProxyRunOptions, server *server.ProxyServer) {
livenessHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "ok")
})
@@ -384,6 +377,4 @@ func (p *Proxy) runHealthServer(o *options.ProxyRunOptions, server *server.Proxy
}
klog.V(1).Infoln("Health server stopped listening")
}()
-
- return nil
}