调整与受管司南之间通知可信节点变化的为控制器向司南发请求推送差值;需要考虑的问题是控制器下线后重新上线如何通知受管司南拉拉取最新信息?(是否有必要?)

Signed-off-by: Chenyang Gao <gps949@outlook.com>
This commit is contained in:
Chenyang Gao
2023-04-07 16:53:11 +08:00
parent 66285ad7f7
commit a7b09b0dfc
15 changed files with 217 additions and 29 deletions

View File

@@ -360,6 +360,8 @@ func (h *Mirage) handleAuthKeyCommon(
Str("machine", machine.Hostname).
Msg("machine was already registered before, refreshing with new auth key")
h.NotifyNaviOrgNodesChange(machine.User.OrganizationID, nodeKey, machine.NodeKey)
machine.NodeKey = nodeKey
machine.AuthKeyID = uint(pak.ID)
machine.AuthKey = pak
@@ -429,6 +431,7 @@ func (h *Mirage) handleAuthKeyCommon(
return
}
h.NotifyNaviOrgNodesChange(machine.User.OrganizationID, nodeKey, "")
}
err = h.UsePreAuthKey(pak)
@@ -539,6 +542,8 @@ func (h *Mirage) handleMachineLogOutCommon(
return
}
h.NotifyNaviOrgNodesChange(machine.User.OrganizationID, "", machine.NodeKey)
log.Info().
Caller().
Str("machine", machine.Hostname).