From 609f4a55e62f36996bb14fa763443095283b3c30 Mon Sep 17 00:00:00 2001 From: lhy1024 Date: Wed, 12 Jun 2024 18:08:54 +0800 Subject: [PATCH] mcs: add more comments about scheduler redirect Signed-off-by: lhy1024 --- server/api/server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/api/server.go b/server/api/server.go index ad614593b2f..7b7066c4f77 100644 --- a/server/api/server.go +++ b/server/api/server.go @@ -51,7 +51,7 @@ func NewHandler(_ context.Context, svr *server.Server) (http.Handler, apiutil.AP // "/checker/{name}", http.MethodPost // "/checker/{name}", http.MethodGet // "/schedulers", http.MethodGet - // "/schedulers/{name}", http.MethodPost + // "/schedulers/{name}", http.MethodPost, which is to be used to pause or resume the scheduler rather than create a new scheduler // "/schedulers/diagnostic/{name}", http.MethodGet // "/scheduler-config", http.MethodGet // "/hotspot/regions/read", http.MethodGet @@ -62,6 +62,8 @@ func NewHandler(_ context.Context, svr *server.Server) (http.Handler, apiutil.AP // Following requests are **not** redirected: // "/schedulers", http.MethodPost // "/schedulers/{name}", http.MethodDelete + // Because the writing of all the config of the scheduling service is in the API server, + // we should not post and delete the scheduler directly in the scheduling service. router.PathPrefix(apiPrefix).Handler(negroni.New( serverapi.NewRuntimeServiceValidator(svr, group), serverapi.NewRedirector(svr, @@ -163,7 +165,7 @@ func NewHandler(_ context.Context, svr *server.Server) (http.Handler, apiutil.AP mcs.SchedulingServiceName, []string{http.MethodGet}), serverapi.MicroserviceRedirectRule( - prefix+"/schedulers/", // Note: this means "/schedulers/{name}" + prefix+"/schedulers/", // Note: this means "/schedulers/{name}", which is to be used to pause or resume the scheduler scheapi.APIPathPrefix+"/schedulers", mcs.SchedulingServiceName, []string{http.MethodPost}),