mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
BREAKING CHANGE: resolve gRPC API proxy targets (machines) on server instead of client, needs upgrade to v0.20 (#247)
Co-authored-by: Pasha Sviderski <me@psviderski.name>
This commit is contained in:
co-authored by
Pasha Sviderski
parent
03ff4cd51d
commit
c95136eae6
@@ -12,21 +12,6 @@ type MachineFilter struct {
|
||||
|
||||
type MachineMembersList []*pb.MachineMember
|
||||
|
||||
func (m MachineMembersList) FindByManagementIP(ip string) *pb.MachineMember {
|
||||
for _, machine := range m {
|
||||
addr, err := machine.Machine.Network.ManagementIp.ToAddr()
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
if addr.String() == ip {
|
||||
return machine
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m MachineMembersList) FindByNameOrID(nameOrID string) *pb.MachineMember {
|
||||
for _, machine := range m {
|
||||
if machine.Machine.Id == nameOrID || machine.Machine.Name == nameOrID {
|
||||
|
||||
Reference in New Issue
Block a user