8000 chore: change the `record` api to the new `events` api by dongjiang1989 · Pull Request #7867 · prometheus-operator/prometheus-operator · GitHub
[go: up one dir, main page]

Skip to content

Conversation

dongjiang1989
Copy link
Member

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

If it fixes an existing issue (bug or feature), use the following keyword:

Closes: #ISSUE-NUMBER

This Pull Request migrates from the old events API (k8s.io/client-go/tools/record) to the new API (k8s.io/client-go/tools/events).

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Verification

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

None

Signed-off-by: dongjiang <dongjiang1989@126.com>
@dongjiang1989 dongjiang1989 requested a review from a team as a code owner September 3, 2025 12:31
@dongjiang1989 dongjiang1989 changed the title Change the record api to the new events api chore: change the record api to the new events api Sep 18, 2025
Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
"namespace", promRule.Namespace,
)
prs.eventRecorder.Eventf(promRule, v1.EventTypeWarning, "InvalidConfiguration", "PrometheusRule %s was rejected due to invalid configuration: %v", promRule.Name, err)
prs.eventRecorder.Eventf(promRule, nil, v1.EventTypeWarning, invalidConfiguration, InvalidConfigurationEvent, "PrometheusRule %s was rejected due to invalid configuration: %v", promRule.Name, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as previously about the related argument. But given that it's not straightforward to inject the workload resource (e.g. Prometheus or ThanosRuler), we can leave this to a follow-up PR.

Copy link
Member Author
@dongjiang1989 dongjiang1989 Sep 22, 2025

Choose a reason for hiding this comment

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

Thanks @simonpasquier
I Got it
The Next PR fix it

Signed-off-by: dongjiang <dongjiang1989@126.com>
@dongjiang1989
Copy link
Member Author

@simonpasquier Please recheck it

Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
Copy link
Contributor
@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

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

Thanks!

@simonpasquier simonpasquier merged commit e51ae42 into prometheus-operator:main Sep 26, 2025
22 checks passed
@dongjiang1989 dongjiang1989 deleted the change-new-events-api branch September 26, 2025 09:16
simonpasquier added a commit to simonpasquier/prometheus-operator that referenced this pull request Sep 26, 2025
This is a follow-up of prometheus-operator#7867 which refactors the event handling to
always inject the related object.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
simonpasquier added a commit that referenced this pull request Sep 26, 2025
This is a follow-up of #7867 which refactors the event handling to
always inject the related object.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0