Skip to content

Commit

Permalink
add migrate fix on tags init
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Nov 8, 2024
1 parent a7ccf13 commit ce93c9e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions logic/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ func CreateIngressGateway(netid string, nodeid string, ingress models.IngressReq
if node.Metadata == "" {
node.Metadata = "This host can be used for remote access"
}
if node.Tags == nil {
node.Tags = make(map[models.TagID]struct{})
}
node.Tags[models.TagID(fmt.Sprintf("%s.%s", netid, models.RemoteAccessTagName))] = struct{}{}
err = UpsertNode(&node)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ func updateNodes() {
}
for _, node := range nodes {
node := node
if node.Tags == nil {
node.Tags = make(map[models.TagID]struct{})
logic.UpsertNode(&node)
}
if node.IsIngressGateway {
tagID := models.TagID(fmt.Sprintf("%s.%s", node.Network,
models.RemoteAccessTagName))
Expand Down

0 comments on commit ce93c9e

Please sign in to comment.