From b5f839a920f1c56e46719a624a5ab84bb7fc6186 Mon Sep 17 00:00:00 2001 From: Prabhat Khera <91852476+prabhat-org@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:31:28 +1300 Subject: [PATCH] fix(stacks): make stackName kube stack specific field [EE-6670] (#11316) * fix(stacks): make stackName kube stack specific field [EE-6670] * fix wordings --- api/http/handler/stacks/stack_update_git_redeploy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/http/handler/stacks/stack_update_git_redeploy.go b/api/http/handler/stacks/stack_update_git_redeploy.go index 478ed0ae9..dcf97b8ea 100644 --- a/api/http/handler/stacks/stack_update_git_redeploy.go +++ b/api/http/handler/stacks/stack_update_git_redeploy.go @@ -46,7 +46,7 @@ func (payload *stackGitRedployPayload) Validate(r *http.Request) error { // @produce json // @param id path int true "Stack identifier" // @param endpointId query int false "Stacks created before version 1.18.0 might not have an associated environment(endpoint) identifier. Use this optional parameter to set the environment(endpoint) identifier used by the stack." -// @param body body stackGitRedployPayload true "Git configs for pull and redeploy a stack" +// @param body body stackGitRedployPayload true "Git configs for pull and redeploy of a stack. **StackName** may only be populated for Kuberenetes stacks, and if specified with a blank string, it will be set to blank" // @success 200 {object} portainer.Stack "Success" // @failure 400 "Invalid request" // @failure 403 "Permission denied" @@ -138,7 +138,7 @@ func (handler *Handler) stackGitRedeploy(w http.ResponseWriter, r *http.Request) } } - if payload.StackName != "" { + if stack.Type == portainer.KubernetesStack { stack.Name = payload.StackName }