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

feat: add AnnotatedEventf to events.EventRecorder #124170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devholic
Copy link

@devholic devholic commented Apr 3, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Unlike EventRecorder interface in tools/record package, EventRecorder interface in tools/events package has no AnnotatedEventf method. Due to the lack of this method, clients are unable to record annotations on events/v1.Event through the recorder interface.

This PR adds AnnotatedEventf to EventRecorder interfaceintools/eventspackage to allow clients to recordevents/v1.Event` with annotations.

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

Unlike `EventRecorder` interface in `tools/record` package,
`EventRecorder` interface in `tools/events` package has no
`AnnotatedEventf` method. Due to the lack of this method, clients are
unable to record annotations on `events/v1.Event` through the recorder
interface.

This commit adds `AnnotatedEventf` to `EventRecorder` interface` in
`tools/events` package to allow clients to record `events/v1.Event` with
annotations.

Signed-off-by: Sunghoon Kang <me@hoon.dev>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. labels Apr 3, 2024
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.30 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.30.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Apr 3 02:18:49 UTC 2024.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 3, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @devholic!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 3, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @devholic. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Apr 3, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: devholic
Once this PR has been reviewed and has the lgtm label, please assign deads2k for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 3, 2024
@devholic devholic marked this pull request as ready for review April 3, 2024 16:36
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 3, 2024
@alexzielenski
Copy link
Contributor

/cc @jiahuif
Do you have context for this/know someone who might?

@benluddy
Copy link
Contributor

benluddy commented Apr 9, 2024

It might be a good idea to discuss how this would interact with event correlation and to consider possible performance impacts.

Instrumentation technically owns k8s.io/client-go/tools/events, maybe a good way to get traction on this would be to bring it up for discussion at one of the regular sig-instrumentation meetings?

/sig instrumentation

@k8s-ci-robot k8s-ci-robot added the sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. label Apr 9, 2024
@liggitt
Copy link
Member

liggitt commented Apr 10, 2024

It might be a good idea to discuss how this would interact with event correlation and to consider possible performance impacts.

Agree. I'm not sure expanding use and variance of events is a great idea… if we were going to add this, I'd want to put guards in place to make sure we didn't start using this in kubelet, etc, which makes me wonder if it's a good thing to add.

Copy link
Member

@logicalhan logicalhan left a comment

Choose a reason for hiding this comment

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

/assign @dgrisonnet
/triage accepted

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Apr 18, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 18, 2024
@dgrisonnet
Copy link
Member

dgrisonnet commented Apr 19, 2024

There was a PR last year trying to add the same functionality: #115058. Copying the reservation I had here:

I also have reservations on this change and more generally toward adding labels/annotations to the Events. These objects are meant to be self explanatory, if additional information is needed, then Events are most likely not the right vector for this data.
Another aspect is that Events are designed in a way that their structure matters a lot. There are some aggregation mechanisms in the clients that will merge similar Events together and it will completely disregard whatever was added in the labels and annotations.

I am still standing by that today and would want to see a real use case before adding this functionality to the new events API.

I'd want to put guards in place to make sure we didn't start using this in kubelet, etc, which makes me wonder if it's a good thing to add.

Funnily enough this functionality was added to the core/v1 client implementation specifically for Kubelet: #64213, but if we could go back in time, I don't think we should've added it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants