mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-18 22:55:15 +08:00
added ability to force delete if node is requested twice
This commit is contained in:
@@ -395,6 +395,21 @@ func HostExists(h *models.Host) bool {
|
||||
return (err != nil && !database.IsEmptyRecord(err)) || (err == nil)
|
||||
}
|
||||
|
||||
// GetHostByNodeID - returns a host if found to have a node's ID, else nil
|
||||
func GetHostByNodeID(id string) *models.Host {
|
||||
hosts, err := GetAllHosts()
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for i := range hosts {
|
||||
h := hosts[i]
|
||||
if StringSliceContains(h.Nodes, id) {
|
||||
return &h
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func updatePort(p *int) {
|
||||
*p++
|
||||
if *p > maxPort {
|
||||
|
Reference in New Issue
Block a user