Remove binding from PodMonitor's status when workload deletd or invalid Ref#7936
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.
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.
i have heard somewhere that -> naming and managing cache are the toughest things in software development
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
xin 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.