diff --git a/pkg/hypervisor/hypervisor.go b/pkg/hypervisor/hypervisor.go index eb134802fb..c07e9bd284 100644 --- a/pkg/hypervisor/hypervisor.go +++ b/pkg/hypervisor/hypervisor.go @@ -172,7 +172,7 @@ func (hv *Hypervisor) ServeHTTP(w http.ResponseWriter, req *http.Request) { r.Get("/visors/{pk}/routes/{rid}", hv.getRoute()) r.Put("/visors/{pk}/routes/{rid}", hv.putRoute()) r.Delete("/visors/{pk}/routes/{rid}", hv.deleteRoute()) - r.Get("/visors/{pk}/loops", hv.getLoops()) + r.Get("/visors/{pk}/routegroup", hv.getRouteGroup()) r.Get("/visors/{pk}/restart", hv.restart()) r.Post("/visors/{pk}/exec", hv.exec()) r.Post("/visors/{pk}/update", hv.update()) @@ -672,9 +672,9 @@ func makeLoopResp(info visor.LoopInfo) loopResp { } } -func (hv *Hypervisor) getLoops() http.HandlerFunc { +func (hv *Hypervisor) getRouteGroup() http.HandlerFunc { return hv.withCtx(hv.visorCtx, func(w http.ResponseWriter, r *http.Request, ctx *httpCtx) { - loops, err := ctx.RPC.Loops() + loops, err := ctx.RPC.RouteGroups() if err != nil { httputil.WriteJSON(w, r, http.StatusInternalServerError, err) return diff --git a/pkg/router/router.go b/pkg/router/router.go index 5655751ec1..6ea5c4aa8e 100644 --- a/pkg/router/router.go +++ b/pkg/router/router.go @@ -527,7 +527,7 @@ func (r *router) Close() error { return nil } - r.logger.Info("Closing all App connections and Loops") + r.logger.Info("Closing all App connections and RouteGroups") r.once.Do(func() { close(r.done) diff --git a/pkg/visor/rpc.go b/pkg/visor/rpc.go index 393004ac22..92f725ef4c 100644 --- a/pkg/visor/rpc.go +++ b/pkg/visor/rpc.go @@ -460,9 +460,9 @@ type LoopInfo struct { FwdRule routing.Rule } -// Loops retrieves loops via rules of the routing table. +// RouteGroups retrieves loops via rules of the routing table. func (r *RPC) Loops(_ *struct{}, out *[]LoopInfo) (err error) { - defer r.logReq("Loops", nil)(out, &err) + defer r.logReq("RouteGroups", nil)(out, &err) var loops []LoopInfo diff --git a/pkg/visor/rpc_client.go b/pkg/visor/rpc_client.go index 6851f0afeb..cb46a0afd0 100644 --- a/pkg/visor/rpc_client.go +++ b/pkg/visor/rpc_client.go @@ -57,7 +57,7 @@ type RPCClient interface { SaveRoutingRule(rule routing.Rule) error RemoveRoutingRule(key routing.RouteID) error - Loops() ([]LoopInfo, error) + RouteGroups() ([]LoopInfo, error) Restart() error Exec(command string) ([]byte, error) @@ -230,10 +230,10 @@ func (rc *rpcClient) RemoveRoutingRule(key routing.RouteID) error { return rc.Call("RemoveRoutingRule", &key, &struct{}{}) } -// Loops calls Loops. -func (rc *rpcClient) Loops() ([]LoopInfo, error) { +// RouteGroups calls RouteGroups. +func (rc *rpcClient) RouteGroups() ([]LoopInfo, error) { var loops []LoopInfo - err := rc.Call("Loops", &struct{}{}, &loops) + err := rc.Call("RouteGroups", &struct{}{}, &loops) return loops, err } @@ -580,8 +580,8 @@ func (mc *mockRPCClient) RemoveRoutingRule(key routing.RouteID) error { return nil } -// Loops implements RPCClient. -func (mc *mockRPCClient) Loops() ([]LoopInfo, error) { +// RouteGroups implements RPCClient. +func (mc *mockRPCClient) RouteGroups() ([]LoopInfo, error) { var loops []LoopInfo rules := mc.rt.AllRules()