Skip to content

Commit

Permalink
fix: adapt to e2e test env
Browse files Browse the repository at this point in the history
Signed-off-by: spencercjh <[email protected]>
  • Loading branch information
spencercjh committed Jan 2, 2025
1 parent 75a91b4 commit 522c6c0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions agent/common/permission.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package common

import (
"os"
"slices"

"github.com/containerd/containerd/pkg/cap"
)

func HasPermission() (bool, error) {
// root is considered as having CAP_BPF capability.
if os.Geteuid() > 0 {
return true, nil
}
current, err := cap.Current()
if err != nil {
return false, err
Expand Down

0 comments on commit 522c6c0

Please sign in to comment.