Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 23, 2023

Conversation

ZP-AlwaysWin
Copy link
Contributor

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
Copy link

codecov-commenter commented May 17, 2023

Codecov Report

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

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

❗ 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
@@            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

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

@ZP-AlwaysWin
Copy link
Contributor Author

/assign @fuweid
PTAL

Copy link
Member

@klihub klihub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

The fix itself is very valid, but could I ask you to rewrite the commit message to something a bit more descriptive. Maybe something like this:

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

@ZP-AlwaysWin ZP-AlwaysWin changed the title fix code bug Fix ParseEventMask to produce proper masks for 'pod' and 'container' shorthand event notations. May 18, 2023
Signed-off-by: ZP-AlwaysWin <zhangpeng63@baidu.com>
@ZP-AlwaysWin
Copy link
Contributor Author

@klihub Thanks ! Modified PTAL

@ZP-AlwaysWin
Copy link
Contributor Author

/assign @samuelkarp
PTAL

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mikebrow mikebrow merged commit 4f8b633 into containerd:main May 23, 2023
@dmcgowan
Copy link
Member

dmcgowan commented Nov 1, 2023

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

@ZP-AlwaysWin
Copy link
Contributor Author

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

ok

@ZP-AlwaysWin ZP-AlwaysWin deleted the logger branch February 22, 2024 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants