mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 14:29:40 +02:00
* refactor(stack): create unique name function * refactor(stack): change stack resource control id * feat(stacks): validate stack unique name in endpoint * feat(stacks): prevent name collision with external stacks * refactor(stacks): move resource id util * refactor(stacks): supply resource id util with name and endpoint * fix(docker): calculate swarm resource id * feat(stack): prevent migration if stack name already exist * feat(authorization): use stackutils
12 lines
274 B
Go
12 lines
274 B
Go
package stackutils
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
portainer "github.com/portainer/portainer/api"
|
|
)
|
|
|
|
// ResourceControlID returns the stack resource control id
|
|
func ResourceControlID(endpointID portainer.EndpointID, name string) string {
|
|
return fmt.Sprintf("%d_%s", endpointID, name)
|
|
}
|