-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Remove binding from PodMonitor's status when workload deletd or invalid Ref #7936
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
Conversation
@simonpasquier merge request |
We could merge it (once the tests pass) but I'd like that we explore how we can reduce the code duplication (it won't be sustainable when we add probes, prometheusrules, etc.). |
don't know why !! but things are not updating, logic is similar to smon |
The operator's logs say
but I'm not sure why and if it's related to the test failure. Have you tested manually? |
yes it is not updating manually also, in my local |
this is not related to test failure, ig this is due to the prom is still present in the queue or cache after it is deleted. Will try to fix this later |
the problem happens here
the obj is not typecasted in podMonitor @simonpasquier, i think the issue is with cache |
pkg/prometheus/server/operator.go
Outdated
} | ||
|
||
// Remove bindings from all podMonitors which reference the workload. | ||
if err := c.promInfs.ListAll(labels.Everything(), func(obj any) { |
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.
small typo, big effect :)
if err := c.promInfs.ListAll(labels.Everything(), func(obj any) { | |
if err := c.pmonInfs.ListAll(labels.Everything(), func(obj any) { |
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.
i have heard somewhere that -> naming and managing cache are the toughest things in software development
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.
done the changes
7a2bb75
into
prometheus-operator:main
Description
Remove binding from PodMonitor's status when workload deletd or invalid Ref
_Closes: #7919
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.