Skip to content

Commit

Permalink
Fixes incorrect error message in error channel handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jpvajda committed Jan 31, 2025
1 parent d6f1755 commit 914f66f
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions pkg/api/agent/v1/websocket/chan_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,20 @@ func (r *ChanRouter) processErrorResponse(byMsg []byte) error {
}

func (r *ChanRouter) processInjectionRefused(byMsg []byte) error {
var response interfaces.InjectionRefusedResponse
if err := json.Unmarshal(byMsg, &response); err != nil {
return err
}
action := func(data []byte) error {
var msg interfaces.InjectionRefusedResponse
if err := json.Unmarshal(byMsg, &msg); err != nil {
klog.V(1).Infof("json.Unmarshal(InjectionRefusedResponse) failed. Err: %v\n", err)
return err
}

for _, ch := range r.injectionRefusedResponse {
*ch <- &response
for _, ch := range r.injectionRefusedResponse {
*ch <- &msg
}
return nil
}
return nil

return r.processGeneric(string(interfaces.TypeInjectionRefusedResponse), byMsg, action)
}

func (r *ChanRouter) processKeepAlive(byMsg []byte) error {
Expand Down

0 comments on commit 914f66f

Please sign in to comment.