Skip to content

Commit

Permalink
Fix bpfLogLevelMap nil issue.
Browse files Browse the repository at this point in the history
Signed-off-by: kangmingfa <1640528278@qq.com>
  • Loading branch information
bfforever committed Jul 3, 2024
1 parent 509dbec commit bb4419d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/status/status_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ func (s *Server) bpfLogLevel(w http.ResponseWriter, r *http.Request) {
}
key := uint32(0)
levelPtr := uint32(level)
if s.bpfLogLevelMap == nil {
http.Error(w, fmt.Errorf("update log level error:%v", "bpfLogLevelMap is nil").Error(), http.StatusBadRequest)
return
}
if err := s.bpfLogLevelMap.Update(&key, &levelPtr, ebpf.UpdateAny); err != nil {
http.Error(w, fmt.Errorf("update log level error:%v", err).Error(), http.StatusBadRequest)
return
Expand Down

0 comments on commit bb4419d

Please sign in to comment.