containerd / nri

Node Resource Interface
Apache License 2.0
257 stars 65 forks source link

Fix ParseEventMask to produce proper masks for 'pod' and 'container' shorthand event notations. #39

Closed ZP-AlwaysWin closed 1 year ago

ZP-AlwaysWin commented 1 year ago

the keys in code's bits map is lowercase

bits := map[string]Event{
        "runpodsandbox":       Event_RUN_POD_SANDBOX,
        "stoppodsandbox":      Event_STOP_POD_SANDBOX,
        "removepodsandbox":    Event_REMOVE_POD_SANDBOX,
        "createcontainer":     Event_CREATE_CONTAINER,
        "postcreatecontainer": Event_POST_CREATE_CONTAINER,
        "startcontainer":      Event_START_CONTAINER,
        "poststartcontainer":  Event_POST_START_CONTAINER,
        "updatecontainer":     Event_UPDATE_CONTAINER,
        "postupdatecontainer": Event_POST_UPDATE_CONTAINER,
        "stopcontainer":       Event_STOP_CONTAINER,
        "removecontainer":     Event_REMOVE_CONTAINER,
    }

so should fix if strings.Contains(name, "Pod") => if strings.Contains(name, "pod")

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +0.16 :tada:

Comparison is base (2a8b655) 63.83% compared to head (a512595) 64.00%.

:exclamation: Current head a512595 differs from pull request most recent head da291a6. Consider uploading reports for the commit da291a6 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #39 +/- ## ========================================== + Coverage 63.83% 64.00% +0.16% ========================================== Files 9 9 Lines 1800 1800 ========================================== + Hits 1149 1152 +3 + Misses 500 497 -3 Partials 151 151 ``` [see 1 file with indirect coverage changes](https://app.codecov.io/gh/containerd/nri/pull/39/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=containerd)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

ZP-AlwaysWin commented 1 year ago

/assign @fuweid PTAL

ZP-AlwaysWin commented 1 year ago

@klihub Thanks ! Modified PTAL

ZP-AlwaysWin commented 1 year ago

/assign @samuelkarp PTAL

dmcgowan commented 1 year ago

@ZP-AlwaysWin Do you want zhangpeng as name for change log?

ZP-AlwaysWin commented 9 months ago

@ZP-AlwaysWin Do you want zhangpeng as name for change log?

ok