mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
refactor(edge): init endpoint relation when endpoint is created [BE-11928] (#814)
This commit is contained in:
parent
b43f864511
commit
b6f3682a62
10 changed files with 62 additions and 43 deletions
|
@ -563,6 +563,10 @@ func (handler *Handler) saveEndpointAndUpdateAuthorizations(tx dataservices.Data
|
|||
return err
|
||||
}
|
||||
|
||||
if err := endpointutils.InitializeEdgeEndpointRelation(endpoint, tx); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, tagID := range endpoint.TagIDs {
|
||||
if err := tx.Tag().UpdateTagFunc(tagID, func(tag *portainer.Tag) {
|
||||
tag.Endpoints[endpoint.ID] = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue