fix: add mutex to interface retrieval into flannel addon mode

This commit is contained in:
RouxAntoine 2022-05-17 19:47:30 +02:00
parent aca5c8dd24
commit f771462b05
No known key found for this signature in database
GPG Key ID: 098FB66FC0475E70

View File

@ -56,6 +56,8 @@ func (f *flannel) Gw(_, _ net.IP, subnet *net.IPNet) net.IP {
// Index returns the index of the Flannel interface.
func (f *flannel) Index() int {
f.mu.Lock()
defer f.mu.Unlock()
return f.iface
}