Skip to content

Commit

Permalink
Update error message
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Anh Duong <[email protected]>
  • Loading branch information
vietanhduong committed Nov 26, 2024
1 parent dfcfd09 commit 17ee16d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion compiler/compiler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func Test_Compile(t *testing.T) {
require.False(t, info.IsDir())
require.NotZero(t, info.Size())

mod, err := wbpf.NewModule(wbpf.WithElfFile(output))
mod, _, err := wbpf.NewModule(wbpf.WithElfFile(output))
require.NoError(t, err, "Failed to new wbpf module")
mod.Close()
})
Expand Down
6 changes: 3 additions & 3 deletions pinning.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ func mapsToReplace(toReplace []string, spec *ebpf.CollectionSpec, coll *ebpf.Col
for _, key := range toReplace {
m, ok := coll.Maps[key]
if !ok {
return nil, fmt.Errorf("Map %s not found in Collection", key)
return nil, fmt.Errorf("map %s not found in collection", key)
}
ms, ok := spec.Maps[key]
if !ok {
return nil, fmt.Errorf("MapSpec %s not found in CollectionSpec", key)
return nil, fmt.Errorf("map spec %s not found in collection spec", key)
}

if m.IsPinned() {
return nil, fmt.Errorf("Map %s was already pinned by ebpf-go: LIBBPF_PIN_BY_NAME and CILIUM_PIN_REPLACE are mutually exclusive", ms.Name)
return nil, fmt.Errorf("map %s was already pinned by ebpf-go: LIBBPF_PIN_BY_NAME is mutually exclusive", ms.Name)
}

pins = append(pins, toPin{m: m, path: path.Join(opts.Maps.PinPath, ms.Name)})
Expand Down

0 comments on commit 17ee16d

Please sign in to comment.