fix: add ownership check before deleting PodMonitor#9340
Merged
mnencia merged 3 commits intocloudnative-pg:mainfrom Jan 15, 2026
Merged
fix: add ownership check before deleting PodMonitor#9340mnencia merged 3 commits intocloudnative-pg:mainfrom
mnencia merged 3 commits intocloudnative-pg:mainfrom
Conversation
Contributor
|
❗ By default, the pull request is configured to backport to all release branches.
|
afc2e43 to
b0e9b8f
Compare
Closed
4 tasks
Signed-off-by: Julia Mertz <info@juliamertz.dev>
b0e9b8f to
b5e96ea
Compare
mnencia
approved these changes
Jan 15, 2026
Verify that unowned PodMonitors are not deleted when monitoring is disabled, and that owned PodMonitors are correctly deleted. Update existing test to properly set cluster ownership on the PodMonitor being tested. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
3ee1106 to
7767eea
Compare
armru
approved these changes
Jan 15, 2026
Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
82e78ce to
ed649ac
Compare
gbartolini
approved these changes
Jan 15, 2026
cnpg-bot
pushed a commit
that referenced
this pull request
Jan 15, 2026
The operator was incorrectly deleting manually-created PodMonitors that shared the same name and namespace as the cluster, even when they were not owned by the cluster. This fix adds an ownership check before deleting PodMonitors when monitoring is disabled, ensuring only operator-managed PodMonitors are deleted. Closes #6109 Signed-off-by: Julia Mertz <info@juliamertz.dev> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> (cherry picked from commit 694b3b9)
cnpg-bot
pushed a commit
that referenced
this pull request
Jan 15, 2026
The operator was incorrectly deleting manually-created PodMonitors that shared the same name and namespace as the cluster, even when they were not owned by the cluster. This fix adds an ownership check before deleting PodMonitors when monitoring is disabled, ensuring only operator-managed PodMonitors are deleted. Closes #6109 Signed-off-by: Julia Mertz <info@juliamertz.dev> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> (cherry picked from commit 694b3b9)
cnpg-bot
pushed a commit
that referenced
this pull request
Jan 15, 2026
The operator was incorrectly deleting manually-created PodMonitors that shared the same name and namespace as the cluster, even when they were not owned by the cluster. This fix adds an ownership check before deleting PodMonitors when monitoring is disabled, ensuring only operator-managed PodMonitors are deleted. Closes #6109 Signed-off-by: Julia Mertz <info@juliamertz.dev> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> (cherry picked from commit 694b3b9)
mnencia
added a commit
that referenced
this pull request
Jan 20, 2026
The operator was incorrectly deleting manually-created PodMonitors that shared the same name and namespace as the cluster, even when they were not owned by the cluster. This fix adds an ownership check before deleting PodMonitors when monitoring is disabled, ensuring only operator-managed PodMonitors are deleted. Closes #6109 Signed-off-by: Julia Mertz <info@juliamertz.dev> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Armando Ruocco <armando.ruocco@enterprisedb.com> (cherry picked from commit 694b3b9)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The operator was incorrectly deleting manually-created PodMonitors that shared the same name and namespace as the cluster, even when they were not owned by the cluster.
This fix adds an ownership check before deleting PodMonitors when monitoring is disabled, ensuring only operator-managed PodMonitors are deleted.
Closes #6109