rando logs

This commit is contained in:
afeiszli
2021-07-25 20:42:07 +00:00
parent 9fb01f9620
commit f1cac641dc
4 changed files with 21 additions and 10 deletions

View File

@@ -3,7 +3,7 @@ package controller
import (
"context"
"fmt"
"log"
"github.com/gravitl/netmaker/functions"
nodepb "github.com/gravitl/netmaker/grpc"
"github.com/gravitl/netmaker/models"
@@ -170,6 +170,7 @@ func (s *NodeServiceServer) CheckIn(ctx context.Context, req *nodepb.CheckInReq)
PersistentKeepalive: data.GetKeepalive(),
PublicKey: data.GetPublickey(),
UDPHolePunch: data.GetUdpholepunch(),
SaveConfig: data.GetSaveconfig(),
}
checkinresponse, err := NodeCheckIn(node, node.Network)
@@ -201,6 +202,7 @@ func (s *NodeServiceServer) CheckIn(ctx context.Context, req *nodepb.CheckInReq)
func (s *NodeServiceServer) UpdateNode(ctx context.Context, req *nodepb.UpdateNodeReq) (*nodepb.UpdateNodeRes, error) {
// Get the node data from the request
data := req.GetNode()
log.Println("DATA:",data)
// Now we have to convert this into a NodeItem type to convert into BSON
newnode := models.Node{
// ID: primitive.NilObjectID,
@@ -228,11 +230,7 @@ func (s *NodeServiceServer) UpdateNode(ctx context.Context, req *nodepb.UpdateNo
networkName := newnode.Network
network, _ := functions.GetParentNetwork(networkName)
err := newnode.Validate(true)
if err != nil {
return nil, err
}
log.Println("NODE SAVECONFIG:",newnode.SaveConfig)
node, err := functions.GetNodeByMacAddress(networkName, macaddress)
if err != nil {
return nil, status.Errorf(