fix: skip bond itself when matching interface (Equinix Metal)

This fixes a problem when platform network configuration might have
already been applied from the cached on disk representation, and in that
base e.g. `bond0` MAC is same as `eth0`, so Talos might mistakenly pick
up `bond0` as a slave to itself instead of `eth0`.

Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
This commit is contained in:
Andrey Smirnov 2022-07-18 21:03:48 +04:00
parent f1c2b5c558
commit 1677bcc4b2
No known key found for this signature in database
GPG Key ID: 7B26396447AB6DFD

View File

@ -145,7 +145,9 @@ func (p *EquinixMetal) ParseMetadata(equinixMetadata *Metadata) (*runtime.Platfo
found := false
for _, hostIf := range hostInterfaces {
if hostIf.HardwareAddr.String() == iface.MAC {
// if the bond configuration has already been applied, bond0 inherits the MAC address of the first slave (e.g. eth0)
// we don't want to match on the bond, so we skip it explicitly
if hostIf.HardwareAddr.String() == iface.MAC && hostIf.Name != iface.Bond {
found = true
networkConfig.Links = append(networkConfig.Links,