Repository navigation
Conversation
Signed-off-by: Tayler Geiger <tayler@redhat.com>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
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.
OLM creates copied ClusterServiceVersions in every target namespace for operators installed through an AllNamespaces OperatorGroup. To avoid rewriting unchanged copies, copied-CSV reconciliation compares hashes of the desired projection and the copy observed through the informer cache.
The previous spec hash included every label and annotation on the copied CSV. If mutating admission or API-server normalization added metadata to the stored copy, the observed hash differed from the hash of OLM’s desired object even though the resulting stored CSV was unchanged. OLM therefore issued a full-object
PUTon every reconciliation.The API server accepted those requests but skipped the etcd write, leaving
resourceVersionstatic. The cluster still paid the per-request cost—authentication, authorization, admission, serialization, and an audit event. At scale, this produced the continuous no-op CSV update stream described in OCPBUGS-147755.This changes the copied-CSV projection hash to include only the content OLM manages and uses for reconciliation:
olm.copiedFromlabelCSV status remains hashed separately. The comparison still uses the existing informer cache and adds no API requests.
As a result, admission-injected or normalized metadata no longer appears as copied-CSV drift. Genuine changes to spec, status, or OLM-managed metadata still update the copied CSV. Standalone changes to metadata that OLM does not manage no longer trigger a reconciliation write; this prevents OLM from repeatedly issuing writes that the API server normalizes back into no-ops.
Testing remarks:
Added
TestCopyableCSVHashIgnoresUnmanagedMetadata, which verifies that:The existing
TestCopyToNamespacecoverage also verifies that matching spec and status hashes produce no update actions.On an affected cluster, after copied CSVs have stabilized, the OLM-attributed CSV update rate should remain zero:
sum(rate(apiserver_request_total{
verb="PUT",
resource="clusterserviceversions",
userAgent="olm/v0.0.0"
}[5m]))
Copied-CSV resourceVersion values should also remain unchanged across reconciliation cycles.
Reviewer Checklist
/doc[FLAKE]are truly flaky and have an issueCloses OCPBUGS-147755