mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 05:49:40 +02:00
refact kub deploy logic
This commit is contained in:
parent
5d2fe2d818
commit
cbfdd58ece
6 changed files with 32 additions and 23 deletions
|
@ -214,7 +214,11 @@ func (handler *Handler) deployStack(r *http.Request, stack *portainer.Stack, end
|
|||
if stack.Namespace == "" {
|
||||
return &httperror.HandlerError{StatusCode: http.StatusInternalServerError, Message: "Invalid namespace", Err: errors.New("Namespace must not be empty when redeploying kubernetes stacks")}
|
||||
}
|
||||
_, err := handler.deployKubernetesStack(r, endpoint, stack, k.KubeAppLabels{
|
||||
tokenData, err := security.RetrieveTokenData(r)
|
||||
if err != nil {
|
||||
return &httperror.HandlerError{StatusCode: http.StatusBadRequest, Message: "Failed to retrieve user token data", Err: err}
|
||||
}
|
||||
_, err = handler.deployKubernetesStack(tokenData.ID, endpoint, stack, k.KubeAppLabels{
|
||||
StackID: int(stack.ID),
|
||||
Name: stack.Name,
|
||||
Owner: stack.CreatedBy,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue