pkg/mesh: ignore CNI IP from private IPs
We need to ignore the CNI IP address from the searched IPs, as this will not be a routable IP address.
This commit is contained in:
@@ -234,7 +234,11 @@ func New(backend Backend, encapsulate Encapsulate, granularity Granularity, host
|
||||
if err := ioutil.WriteFile(PrivateKeyPath, private, 0600); err != nil {
|
||||
return nil, fmt.Errorf("failed to write private key to disk: %v", err)
|
||||
}
|
||||
privateIP, publicIP, err := getIP(hostname)
|
||||
cniIndex, err := cniDeviceIndex()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to query netlink for CNI device: %v", err)
|
||||
}
|
||||
privateIP, publicIP, err := getIP(hostname, cniIndex)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to find public IP: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user