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

refact: EventerType and improve consistency #24665

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

ksw2000
Copy link
Contributor

@ksw2000 ksw2000 commented Nov 25, 2024

In the original implementation in libpod/events/config.go, iota was used to design EventerType.
However, in libpod/events/events_freebsd.go and libpod/events/events_linux.go, the NewEventer function still relies on string comparisons to determine which EventerType to use.

  1. Completed the EventerType comment.
  2. Changed EventerType to be represented as a string.
  3. Since EventerType is designed to be entirely lowercase, changed the comparison to use lowercase instead of uppercase.
  4. Renamed newEventJournalD to newJournalDEventer, similar to the functions newLogFileEventer and newNullEventer
  5. Removed redundant error-checking steps in events_linux.go.

Does this PR introduce a user-facing change?

None

1. Completed the EventerType comment.
2. Changed EventerType to be represented as a string.
3. Since EventerType is designed to be entirely lowercase, changed the comparison to use lowercase instead of uppercase.
4. Renamed newEventJournalD to newJournalDEventer.
5. Removed redundant error-checking steps in events_linux.go.

Signed-off-by: ksw2000 <[email protected]>
@openshift-ci openshift-ci bot added release-note-none do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Nov 25, 2024
@ksw2000 ksw2000 marked this pull request as ready for review November 25, 2024 09:55
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 25, 2024
Copy link
Member

@lsm5 lsm5 left a comment

Choose a reason for hiding this comment

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

LGTM based on my very limited knowledge of this. If we don't need any new tests here, please add the No New Tests label.

@Luap99 @mheon @containers/podman-maintainers PTAL.

@Luap99 Luap99 added the No New Tests Allow PR to proceed without adding regression tests label Nov 25, 2024
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

openshift-ci bot commented Nov 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ksw2000, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 25, 2024
@mheon
Copy link
Member

mheon commented Nov 25, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 25, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit aba98ad into containers:main Nov 25, 2024
78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. No New Tests Allow PR to proceed without adding regression tests release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants