host-local: make Store interface support to get ip list by id
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
This commit is contained in:
@ -81,6 +81,16 @@ func (s *FakeStore) ReleaseByID(id string, ifname string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *FakeStore) GetByID(id string, ifname string) []net.IP {
|
||||
var ips []net.IP
|
||||
for k, v := range s.ipMap {
|
||||
if v == id {
|
||||
ips = append(ips, net.ParseIP(k))
|
||||
}
|
||||
}
|
||||
return ips
|
||||
}
|
||||
|
||||
func (s *FakeStore) SetIPMap(m map[string]string) {
|
||||
s.ipMap = m
|
||||
}
|
||||
|
Reference in New Issue
Block a user