-
Notifications
You must be signed in to change notification settings - Fork 3.8k
chore: change the record
api to the new events
api
#7867
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
chore: change the record
api to the new events
api
#7867
Conversation
Signed-off-by: dongjiang <dongjiang1989@126.com>
record
api to the new events
apirecord
api to the new events
api
Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
pkg/operator/rules.go
Outdated
"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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
@simonpasquier Please recheck it |
0b53d36
to
a48b1c3
Compare
E880
a>
Signed-off-by: dongjiang <dongjiang1989@126.com>
Signed-off-by: dongjiang <dongjiang1989@126.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
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>
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>
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.