Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Oct 30, 2023
1 parent 77c19d4 commit d7adde1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/mcs/scheduling/server/apis/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package apis
import (
"fmt"
"net/http"
"path"
"strconv"
"sync"

Expand Down Expand Up @@ -129,7 +130,8 @@ func (s *Service) RegisterSchedulersRouter() {
router := s.root.Group("schedulers")
router.GET("", getSchedulers)
router.GET("/diagnostic/:name", getDiagnosticResult)
router.GET("/config/:name/:suffix", getSchedulerConfigByName)
router.GET("/config/:name/list", getSchedulerConfigByName)
router.GET("/config/:name/roles", getSchedulerConfigByName) // compatibility for shuffle-region-scheduler
// TODO: in the future, we should split pauseOrResumeScheduler to two different APIs.
// And we need to do one-to-two forwarding in the API middleware.
router.POST("/:name", pauseOrResumeScheduler)
Expand Down Expand Up @@ -414,8 +416,7 @@ func getSchedulerConfigByName(c *gin.Context) {
c.String(http.StatusNotFound, errs.ErrSchedulerNotFound.GenWithStackByArgs().Error())
return
}
suffix := c.Param("suffix")
c.Request.URL.Path = "/" + suffix
c.Request.URL.Path = "/" + path.Base(c.Request.URL.Path)
handlers[name].ServeHTTP(c.Writer, c.Request)
}

Expand Down

0 comments on commit d7adde1

Please sign in to comment.