mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-01 20:52:57 +08:00
refactored all grpc to be uniform
This commit is contained in:
@@ -101,9 +101,15 @@ func GetPeers(macaddress string, network string, server string, dualstack bool,
|
||||
// Instantiate the BlogServiceClient with our client connection to the server
|
||||
wcclient = nodepb.NewNodeServiceClient(conn)
|
||||
|
||||
nodeData, err := json.Marshal(&nodecfg)
|
||||
if err != nil {
|
||||
ncutils.PrintLog("could not parse node data from config during peer fetch for network "+network, 1)
|
||||
return peers, hasGateway, gateways, err
|
||||
}
|
||||
|
||||
req := &nodepb.Object{
|
||||
Data: macaddress + "###" + network,
|
||||
Type: nodepb.STRING_TYPE,
|
||||
Data: string(nodeData),
|
||||
Type: nodepb.NODE_TYPE,
|
||||
}
|
||||
|
||||
ctx, err := auth.SetJWT(wcclient, network)
|
||||
@@ -274,9 +280,15 @@ func GetExtPeers(macaddress string, network string, server string, dualstack boo
|
||||
// Instantiate the BlogServiceClient with our client connection to the server
|
||||
wcclient = nodepb.NewNodeServiceClient(conn)
|
||||
|
||||
nodeData, err := json.Marshal(&nodecfg)
|
||||
if err != nil {
|
||||
ncutils.PrintLog("could not parse node data from config during peer fetch for network "+network, 1)
|
||||
return peers, err
|
||||
}
|
||||
|
||||
req := &nodepb.Object{
|
||||
Data: macaddress + "###" + network,
|
||||
Type: nodepb.STRING_TYPE,
|
||||
Data: string(nodeData),
|
||||
Type: nodepb.NODE_TYPE,
|
||||
}
|
||||
|
||||
ctx, err := auth.SetJWT(wcclient, network)
|
||||
|
||||
Reference in New Issue
Block a user