File tree Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Expand file tree Collapse file tree 3 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,3 @@ services:
99 - ' server'
1010 app :
1111 build : ' '
12- cap_add :
13- - SYS_PTRACE
Original file line number Diff line number Diff line change @@ -13,5 +13,3 @@ services:
1313 ports :
1414 - ' 5000:5000'
1515 build : ' '
16- cap_add :
17- - SYS_PTRACE
Original file line number Diff line number Diff line change @@ -7,18 +7,17 @@ import (
77)
88
99func 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" :
1415 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" )
2117 }
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" )
2221 }
23- return nil
22+ return err
2423}
You can’t perform that action at this time.
0 commit comments