Skip to content

Commit

Permalink
ss: Log warning instead of return error
Browse files Browse the repository at this point in the history
This commit changes the logic of `parseComDetail` function
to log warning when can't extract service name, and set it
to empty, instead of returning an error.

This is to prevent the matrix generation from failing due to
an `SS` entry without a service name like the following:
`UNCONN 0      0           [::]:6081     [::]:*  `

Signed-off-by: Lior Noy <[email protected]>
  • Loading branch information
liornoy committed May 8, 2024
1 parent 83516cd commit 1b5ae23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ss/ss.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func filterEntries(ssEntries []string) []string {
func parseComDetail(ssEntry string) (*types.ComDetails, error) {

Check failure on line 191 in ss/ss.go

View workflow job for this annotation

GitHub Actions / unit-test

parseComDetail - result 1 (error) is always nil (unparam)
serviceName, err := extractServiceName(ssEntry)
if err != nil {
return nil, err
log.Warningf(err.Error())
}

fields := strings.Fields(ssEntry)
Expand Down

0 comments on commit 1b5ae23

Please sign in to comment.