mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 23:09:41 +02:00
fix(stack) normalize stack name EE-1701 (#5776)
* fix(stack) normalize stack name EE-1701 * fix(stack) normalize swarm stack name and fix rebase error EE-1701 * fix(stack) add front end stack name validation EE-1701 * fix(stack) make stack name regex as a const EE-1701 * fix(stack) reuse stack name regex for compose and swarm EE-1701 * fix(stack) add name validation for stack duplication form EE-1701 Co-authored-by: Simon Meng <simon.meng@portainer.io>
This commit is contained in:
parent
fbcf67bc1e
commit
328abfd74e
11 changed files with 114 additions and 53 deletions
|
@ -45,6 +45,12 @@ type Handler struct {
|
|||
StackDeployer stacks.StackDeployer
|
||||
}
|
||||
|
||||
func stackExistsError(name string) (*httperror.HandlerError){
|
||||
msg := fmt.Sprintf("A stack with the normalized name '%s' already exists", name)
|
||||
err := errors.New(msg)
|
||||
return &httperror.HandlerError{StatusCode: http.StatusConflict, Message: msg, Err: err}
|
||||
}
|
||||
|
||||
// NewHandler creates a handler to manage stack operations.
|
||||
func NewHandler(bouncer *security.RequestBouncer) *Handler {
|
||||
h := &Handler{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue