mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
fix(edgestacks): create new stack [EE-2178] (#6311)
* fix(edgestacks): create new stack [EE-2178] [EE-2178] * refactor(edgestacks): id is required on create
This commit is contained in:
parent
4e77d2d772
commit
87dda810fc
3 changed files with 12 additions and 11 deletions
|
@ -67,14 +67,15 @@ func (service *Service) EdgeStack(ID portainer.EdgeStackID) (*portainer.EdgeStac
|
|||
return &stack, nil
|
||||
}
|
||||
|
||||
// CreateEdgeStack assign an ID to a new Edge stack and saves it.
|
||||
func (service *Service) Create(edgeStack *portainer.EdgeStack) error {
|
||||
return service.connection.CreateObject(
|
||||
// CreateEdgeStack saves an Edge stack object to db.
|
||||
func (service *Service) Create(id portainer.EdgeStackID, edgeStack *portainer.EdgeStack) error {
|
||||
|
||||
edgeStack.ID = id
|
||||
|
||||
return service.connection.CreateObjectWithId(
|
||||
BucketName,
|
||||
func(id uint64) (int, interface{}) {
|
||||
edgeStack.ID = portainer.EdgeStackID(id)
|
||||
return int(edgeStack.ID), edgeStack
|
||||
},
|
||||
int(edgeStack.ID),
|
||||
edgeStack,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ type (
|
|||
EdgeStackService interface {
|
||||
EdgeStacks() ([]portainer.EdgeStack, error)
|
||||
EdgeStack(ID portainer.EdgeStackID) (*portainer.EdgeStack, error)
|
||||
Create(edgeStack *portainer.EdgeStack) error
|
||||
Create(id portainer.EdgeStackID, edgeStack *portainer.EdgeStack) error
|
||||
UpdateEdgeStack(ID portainer.EdgeStackID, edgeStack *portainer.EdgeStack) error
|
||||
DeleteEdgeStack(ID portainer.EdgeStackID) error
|
||||
GetNextIdentifier() int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue