Browse Source

Updated per commit comments.

cameronts 2 years ago
parent
commit
53385eb100
2 changed files with 3 additions and 4 deletions
  1. 2 2
      controllers/node.go
  2. 1 2
      mq/publishers.go

+ 2 - 2
controllers/node.go

@@ -321,7 +321,7 @@ func getNetworkNodes(w http.ResponseWriter, r *http.Request) {
 
 	for _, node := range nodes {
 		if len(node.NetworkSettings.AccessKeys) > 0 {
-			node.NetworkSettings.AccessKeys = nil // not to be sent back to client; client already knows how to join the network
+			node.NetworkSettings.AccessKeys = []models.AccessKey{} // not to be sent back to client; client already knows how to join the network
 		}
 	}
 
@@ -402,7 +402,7 @@ func getNode(w http.ResponseWriter, r *http.Request) {
 	}
 
 	if len(node.NetworkSettings.AccessKeys) > 0 {
-		node.NetworkSettings.AccessKeys = nil // not to be sent back to client; client already knows how to join the network
+		node.NetworkSettings.AccessKeys = []models.AccessKey{} // not to be sent back to client; client already knows how to join the network
 	}
 
 	response := models.NodeGet{

+ 1 - 2
mq/publishers.go

@@ -87,9 +87,8 @@ func NodeUpdate(node *models.Node) error {
 	logger.Log(3, "publishing node update to "+node.Name)
 
 	if len(node.NetworkSettings.AccessKeys) > 0 {
-		node.NetworkSettings.AccessKeys = nil // not to be sent (don't need to spread access keys around the network; we need to know how to reach other nodes, not become them)
+		node.NetworkSettings.AccessKeys = []models.AccessKey{} // not to be sent (don't need to spread access keys around the network; we need to know how to reach other nodes, not become them)
 	}
-	node.AccessKey = "" // no need to send this node's access key to others
 
 	data, err := json.Marshal(node)
 	if err != nil {