mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
refactor(api): use a standard stack identifier (#1980)
This commit is contained in:
parent
da5a430b8c
commit
b4c2820ad7
14 changed files with 150 additions and 38 deletions
|
@ -46,9 +46,9 @@ func (handler *Handler) createComposeStackFromFileContent(w http.ResponseWriter,
|
|||
}
|
||||
}
|
||||
|
||||
stackIdentifier := buildStackIdentifier(payload.Name, endpoint.ID)
|
||||
stackID := handler.StackService.GetNextIdentifier()
|
||||
stack := &portainer.Stack{
|
||||
ID: portainer.StackID(stackIdentifier),
|
||||
ID: portainer.StackID(stackID),
|
||||
Name: payload.Name,
|
||||
Type: portainer.DockerComposeStack,
|
||||
EndpointID: endpoint.ID,
|
||||
|
@ -126,9 +126,9 @@ func (handler *Handler) createComposeStackFromGitRepository(w http.ResponseWrite
|
|||
}
|
||||
}
|
||||
|
||||
stackIdentifier := buildStackIdentifier(payload.Name, endpoint.ID)
|
||||
stackID := handler.StackService.GetNextIdentifier()
|
||||
stack := &portainer.Stack{
|
||||
ID: portainer.StackID(stackIdentifier),
|
||||
ID: portainer.StackID(stackID),
|
||||
Name: payload.Name,
|
||||
Type: portainer.DockerComposeStack,
|
||||
EndpointID: endpoint.ID,
|
||||
|
@ -211,9 +211,9 @@ func (handler *Handler) createComposeStackFromFileUpload(w http.ResponseWriter,
|
|||
}
|
||||
}
|
||||
|
||||
stackIdentifier := buildStackIdentifier(payload.Name, endpoint.ID)
|
||||
stackID := handler.StackService.GetNextIdentifier()
|
||||
stack := &portainer.Stack{
|
||||
ID: portainer.StackID(stackIdentifier),
|
||||
ID: portainer.StackID(stackID),
|
||||
Name: payload.Name,
|
||||
Type: portainer.DockerComposeStack,
|
||||
EndpointID: endpoint.ID,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue