Skip to content

Commit

Permalink
pkg/datapath: return specific error message
Browse files Browse the repository at this point in the history
By not returning a specific error message in case of an error, it makes
it difficult to find out on which location the Cilium agent has failed
to start.

Fixes: 8941e96 ("datapath: Fix race with a deleted device after detection")
Signed-off-by: André Martins <andre@cilium.io>
  • Loading branch information
aanm committed Nov 15, 2022
1 parent dcddb1b commit 4e7209f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/datapath/linux/devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ func NewDeviceManager() (*DeviceManager, error) {
func NewDeviceManagerAt(netns netns.NsHandle) (*DeviceManager, error) {
handle, err := netlink.NewHandleAt(netns)
if err != nil {
return nil, err
return nil, fmt.Errorf("unable to setup device manager: %w", err)
}
return &DeviceManager{
devices: make(map[string]struct{}),
filter: deviceFilter(option.Config.GetDevices()),
handle: handle,
netns: netns,
}, err
}, nil
}

// Detect tries to detect devices to which BPF programs may be loaded.
Expand Down

0 comments on commit 4e7209f

Please sign in to comment.