Skip to content

fix: use update instead of patch#8029

Merged
simonpasquier merged 1 commit intoprometheus-operator:mainfrom
simonpasquier:fix-8028
Oct 15, 2025
Merged

fix: use update instead of patch#8029
simonpasquier merged 1 commit intoprometheus-operator:mainfrom
simonpasquier:fix-8028

Conversation

@simonpasquier
Copy link
Contributor

@simonpasquier simonpasquier commented Oct 14, 2025

Description

On first reconciliation of the status subresource, the patch semantics don't allow to ensure that a second concurrent patch operation doesn't overwrite the first change. Using Update with ResourceVersion (aka optimistic locking), we make sure that the second operation would fail (and be retried).

Closes: #8028

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.


@simonpasquier simonpasquier requested a review from a team as a code owner October 14, 2025 11:52
On first reconciliation of the status subresource, the patch semantics
don't allow to ensure that a second concurrent patch operation doesn't
overwrite the first change. Using Update with ResourceVersion (aka
optimistic locking), we make sure that the second operation would fail
(and be retried).

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@simonpasquier simonpasquier merged commit aa8a932 into prometheus-operator:main Oct 15, 2025
28 of 30 checks passed
@simonpasquier simonpasquier deleted the fix-8028 branch October 15, 2025 08:37
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.

Flaky TestGatedFeatures/ServiceMonitorStatusWithMultipleWorkloads

3 participants