Skip to content

Commit

Permalink
fix(sensor): remove redundant warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Alessio Greggi <ale_grey_91@hotmail.it>
  • Loading branch information
alegrey91 committed Jul 5, 2023
1 parent 270945d commit 722d455
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sensor/CNI.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,16 @@ func getCNINames(ctx context.Context) []string {
}

for _, cni := range supportedCNIs {
p, err := utils.LocateProcessByExecSuffix(cni.processSuffix)
p, _ := utils.LocateProcessByExecSuffix(cni.processSuffix)

if p != nil {
logger.L().Debug("CNI process found", helpers.String("name", cni.name))
CNIs = append(CNIs, cni.name)
}
}

if err != nil {
logger.L().Ctx(ctx).Warning("getCNIName- Failed to locate process for cni",
helpers.String("cni name", cni.name),
helpers.Error(err))
}

if len(CNIs) == 0 {
logger.L().Warning("No CNI found")
}

return CNIs
Expand Down

0 comments on commit 722d455

Please sign in to comment.