Skip to content

🐛 OCPBUGS-147755: avoid no-op copied CSV updates - #3985

Draft
trgeiger wants to merge 1 commit into
operator-framework:masterfrom
trgeiger:OCPBUGS-147755
Draft

trgeiger wants to merge 1 commit into
operator-framework:masterfrom
trgeiger:OCPBUGS-147755

Conversation

@trgeiger

@trgeiger trgeiger commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

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 PUT on every reconciliation.

The API server accepted those requests but skipped the etcd write, leaving resourceVersion static. 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:

  • CSV name
  • CSV spec
  • olm.copiedFrom label
  • OLM managed label
  • OperatorGroup name annotation
  • OperatorGroup namespace annotation

CSV 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:

  • injected labels and annotations do not change the copied-CSV hash;
  • changes to OLM-managed OperatorGroup metadata still change the hash.

The existing TestCopyToNamespace coverage 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

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Bug fixes are accompanied by regression test(s)
  • e2e tests and flake fixes are accompanied evidence of flake testing, e.g. executing the test 100(0) times
  • tech debt/todo is accompanied by issue link(s) in comments in the surrounding code
  • Tests are comprehensible, e.g. Ginkgo DSL is being used appropriately
  • Docs updated or added to /doc
  • Commit messages sensible and descriptive
  • Tests marked as [FLAKE] are truly flaky and have an issue
  • Code is properly formatted

Closes OCPBUGS-147755

Signed-off-by: Tayler Geiger <tayler@redhat.com>
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 4, 2026
@openshift-ci

openshift-ci Bot commented Dec 4, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Dec 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign perdasilva for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant