1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

refactor(api): use a standard stack identifier (#1980)

This commit is contained in:
Anthony Lapenna 2018-06-18 12:07:56 +02:00 committed by GitHub
parent da5a430b8c
commit b4c2820ad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 150 additions and 38 deletions

View file

@ -51,9 +51,9 @@ func (handler *Handler) createSwarmStackFromFileContent(w http.ResponseWriter, r
}
}
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.DockerSwarmStack,
SwarmID: payload.SwarmID,
@ -138,9 +138,9 @@ func (handler *Handler) createSwarmStackFromGitRepository(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.DockerSwarmStack,
SwarmID: payload.SwarmID,
@ -239,9 +239,9 @@ func (handler *Handler) createSwarmStackFromFileUpload(w http.ResponseWriter, r
}
}
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.DockerSwarmStack,
SwarmID: payload.SwarmID,