Browse Source

Merge branch 'GRA-985/host_updates' of https://github.com/gravitl/netmaker into GRA-985/host_updates_logic

Abhishek Kondur 2 years ago
parent
commit
a4d93b6851
1 changed files with 6 additions and 1 deletions
  1. 6 1
      mq/handlers.go

+ 6 - 1
mq/handlers.go

@@ -142,8 +142,13 @@ func UpdateHost(client mqtt.Client, msg mqtt.Message) {
 			return
 		}
 		logger.Log(0, fmt.Sprintf("recieved host update: %+v\n", hostUpdate))
-		// TODO: logic for host update  recieved from client, handle both `update` and `delete` action here.
+		switch hostUpdate.Action {
+		case models.UpdateHost:
+			// TODO: logic to update host recieved from client
+		case models.DeleteHost:
+			// TODO: logic to delete host on the server
 
+		}
 		// if servercfg.Is_EE && ifaceDelta {
 		// 	if err = logic.EnterpriseResetAllPeersFailovers(currentHost.ID.String(), currentHost.Network); err != nil {
 		// 		logger.Log(1, "failed to reset failover list during node update", currentHost.ID.String(), currentHost.Network)