From ce7d52dda3c42bbfdf2479d1f5abaa06d23f11b5 Mon Sep 17 00:00:00 2001 From: ArrisLee Date: Mon, 21 Jun 2021 09:37:16 +1200 Subject: [PATCH] rename git config update handler --- api/http/handler/stacks/handler.go | 4 ++-- .../{stack_update_git.go => stack_update_git_config.go} | 2 +- api/portainer.go | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) rename api/http/handler/stacks/{stack_update_git.go => stack_update_git_config.go} (98%) diff --git a/api/http/handler/stacks/handler.go b/api/http/handler/stacks/handler.go index 83c5eb770..06247f501 100644 --- a/api/http/handler/stacks/handler.go +++ b/api/http/handler/stacks/handler.go @@ -54,8 +54,8 @@ func NewHandler(bouncer *security.RequestBouncer) *Handler { bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.stackDelete))).Methods(http.MethodDelete) h.Handle("/stacks/{id}", bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.stackUpdate))).Methods(http.MethodPut) - h.Handle("/stacks/{id}/git", - bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.stackGitUpdate))).Methods(http.MethodPost) + h.Handle("/stacks/{id}/git/config", + bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.stackGitConfigUpdate))).Methods(http.MethodPost) h.Handle("/stacks/{id}/file", bouncer.AuthenticatedAccess(httperror.LoggerHandler(h.stackFile))).Methods(http.MethodGet) h.Handle("/stacks/{id}/migrate", diff --git a/api/http/handler/stacks/stack_update_git.go b/api/http/handler/stacks/stack_update_git_config.go similarity index 98% rename from api/http/handler/stacks/stack_update_git.go rename to api/http/handler/stacks/stack_update_git_config.go index ff2ecd958..c3840f9f4 100644 --- a/api/http/handler/stacks/stack_update_git.go +++ b/api/http/handler/stacks/stack_update_git_config.go @@ -47,7 +47,7 @@ func (payload *stackGitUpdatePayload) Validate(r *http.Request) error { // @failure 404 "Not found" // @failure 500 "Server error" // @router /stacks/{id}/git [post] -func (handler *Handler) stackGitUpdate(w http.ResponseWriter, r *http.Request) *httperror.HandlerError { +func (handler *Handler) stackGitConfigUpdate(w http.ResponseWriter, r *http.Request) *httperror.HandlerError { stackID, err := request.RetrieveNumericRouteVariableValue(r, "id") if err != nil { return &httperror.HandlerError{StatusCode: http.StatusBadRequest, Message: "Invalid stack identifier route variable", Err: err} diff --git a/api/portainer.go b/api/portainer.go index f3aca4835..37dbe218f 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -4,7 +4,6 @@ import ( "io" "time" - "github.com/portainer/liblicense" gittypes "github.com/portainer/portainer/api/git/types" )