mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
move tags to node model
This commit is contained in:
@@ -48,6 +48,7 @@ type ApiNode struct {
|
||||
InetNodeReq InetNodeReq `json:"inet_node_req" yaml:"inet_node_req"`
|
||||
InternetGwID string `json:"internetgw_node_id" yaml:"internetgw_node_id"`
|
||||
AdditionalRagIps []string `json:"additional_rag_ips" yaml:"additional_rag_ips"`
|
||||
Tags map[TagID]struct{} `json:"tags" yaml:"tags"`
|
||||
}
|
||||
|
||||
// ApiNode.ConvertToServerNode - converts an api node to a server node
|
||||
@@ -123,6 +124,7 @@ func (a *ApiNode) ConvertToServerNode(currentNode *Node) *Node {
|
||||
}
|
||||
convertedNode.AdditionalRagIps = append(convertedNode.AdditionalRagIps, ragIp)
|
||||
}
|
||||
convertedNode.Tags = a.Tags
|
||||
return &convertedNode
|
||||
}
|
||||
|
||||
@@ -180,6 +182,7 @@ func (nm *Node) ConvertToAPINode() *ApiNode {
|
||||
apiNode.FailedOverBy = nm.FailedOverBy
|
||||
apiNode.Metadata = nm.Metadata
|
||||
apiNode.AdditionalRagIps = []string{}
|
||||
apiNode.Tags = nm.Tags
|
||||
for _, ip := range nm.AdditionalRagIps {
|
||||
apiNode.AdditionalRagIps = append(apiNode.AdditionalRagIps, ip.String())
|
||||
}
|
||||
|
Reference in New Issue
Block a user