fix: add mutex to interface retrieval into flannel addon mode
This commit is contained in:
parent
aca5c8dd24
commit
f771462b05
@ -56,6 +56,8 @@ func (f *flannel) Gw(_, _ net.IP, subnet *net.IPNet) net.IP {
|
|||||||
|
|
||||||
// Index returns the index of the Flannel interface.
|
// Index returns the index of the Flannel interface.
|
||||||
func (f *flannel) Index() int {
|
func (f *flannel) Index() int {
|
||||||
|
f.mu.Lock()
|
||||||
|
defer f.mu.Unlock()
|
||||||
return f.iface
|
return f.iface
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user