Skip to content

Commit

Permalink
team device not set unmanage (#4627)
Browse files Browse the repository at this point in the history
Signed-off-by: clyi <[email protected]>
  • Loading branch information
changluyi authored Oct 17, 2024
1 parent cd741a7 commit 603be72
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions pkg/daemon/nm_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,20 @@ func (n *networkManagerSyncer) SetManaged(name string, managed bool) error {
}
}

klog.Infof(`setting device %s NetworkManager property "managed" to %v`, name, managed)
if err = device.SetPropertyManaged(managed); err != nil {
klog.Errorf("failed to set device property managed to %v: %v", managed, err)
return err
deviceType, err := device.GetPropertyDeviceType()
if err != nil {
klog.Errorf("get device %s property device-type failed: %v", name, err)
return nil
}

if deviceType != gonetworkmanager.NmDeviceTypeTeam {
klog.Infof(`setting device %s NetworkManager property "managed" to %v`, name, managed)
if err = device.SetPropertyManaged(managed); err != nil {
klog.Errorf("failed to set device property managed to %v: %v", managed, err)
return err
}
} else {
klog.Infof("device %s is a team interface, not setting NetworkManager property \"unmanaged\"", name)
}

return nil
Expand Down

0 comments on commit 603be72

Please sign in to comment.