File tree 3 files changed +10
-15
lines changed
3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,3 @@ services:
9
9
- ' server'
10
10
app :
11
11
build : ' '
12
- cap_add :
13
- - SYS_PTRACE
Original file line number Diff line number Diff line change @@ -13,5 +13,3 @@ services:
13
13
ports :
14
14
- ' 5000:5000'
15
15
build : ' '
16
- cap_add :
17
- - SYS_PTRACE
Original file line number Diff line number Diff line change @@ -7,18 +7,17 @@ import (
7
7
)
8
8
9
9
func performOSChecks (spyName string ) error {
10
- if disableLinuxChecks {
11
- return nil
12
- }
13
- if spyName == "ebpfspy" {
10
+ var err error
11
+ switch {
12
+ case disableLinuxChecks :
13
+ case spyName == "dotnetspy" :
14
+ case spyName == "ebpfspy" :
14
15
if ! isRoot () {
15
- return errors .New ("when using eBPF you're required to run the agent with sudo" )
16
- }
17
- } else {
18
- if ! caps .HasSysPtraceCap () {
19
- return errors .New ("if you're running pyroscope in a Docker container, add --cap-add=sys_ptrace. " +
20
- "See our Docker Guide for more information: https://pyroscope.io/docs/docker-guide" )
16
+ err = errors .New ("when using eBPF you're required to run the agent with sudo" )
21
17
}
18
+ case ! caps .HasSysPtraceCap ():
19
+ err = errors .New ("if you're running pyroscope in a Docker container, add --cap-add=sys_ptrace. " +
20
+ "See our Docker Guide for more information: https://pyroscope.io/docs/docker-guide" )
22
21
}
23
- return nil
22
+ return err
24
23
}
You can’t perform that action at this time.
0 commit comments