Skip to content

🌱 Remove owner-name-dependent COS cache retention - #3181

Open
perdasilva wants to merge 1 commit into
operator-framework:mainfrom
perdasilva:refactor/remove-cod-cos-owner-labels
Open

perdasilva wants to merge 1 commit into
operator-framework:mainfrom
perdasilva:refactor/remove-cod-cos-owner-labels

Conversation

@perdasilva

@perdasilva perdasilva commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Remove owner-name-dependent retention from operator-controller's ClusterObjectSet cache transform. Every COS now uses the same reduced representation, retaining the fields needed for revision discovery, status reporting, and Helm storage migration:

  • spec.group, spec.revision, and spec.lifecycleState
  • status.completedAt and status.conditions
  • Existing metadata, subject to the existing annotation-stripping behavior

All COSs remain visible to group-based reads. Label stamping, COD caching, and the independent object-controller cache are unchanged.

Because migration reads COSs through this reduced cache, change its completion-status write from a full status update to a merge patch of only completedAt. Optimistic resourceVersion locking preserves concurrent changes and leaves stale reads to be reevaluated on a later reconciliation, without clearing uncached phase status or object counts.

Add regression tests for label-independent trimming, retained metadata and annotation stripping, migration status preservation, conflicts, and successful subsequent reconciliation. The migration regression reproduced detailed-status loss with the old update; removing optimistic locking also caused the concurrency test to fail.

Validation

  • make test-unit
  • go test -race -tags=containers_image_openpgp ./cmd/operator-controller ./internal/operator-controller/applier -count=1
  • golangci-lint run --build-tags containers_image_openpgp ./cmd/operator-controller/... ./internal/operator-controller/applier/... (0 issues)
  • git diff --check

Live E2E was not run. No API definitions or generated files changed.

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Summary by CodeRabbit

  • Bug Fixes
    • Cluster object details and migration status are preserved more consistently across objects with different labels.
    • Migration updates are less likely to overwrite status changes made concurrently. If an update conflicts, migration can be retried using the latest information.

@netlify

netlify Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

👷 Deploy request for olmv1 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2fc0078

@openshift-ci

openshift-ci Bot commented Nov 16, 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 joelanford 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 Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The ClusterObjectSet cache transform now retains selected spec and status fields for all objects. Migration status updates preserve other status fields. Revision completion uses an optimistic-lock status patch.

Changes: Migration Status Preservation

Layer / File(s) Summary
ClusterObjectSet cache projection
cmd/operator-controller/main.go, cmd/operator-controller/main_test.go
The transform retains selected spec and status fields for every ClusterObjectSet. Tests cover label configurations and removal of uncached fields and the last-applied annotation.
ClusterObjectSet migration status
cmd/operator-controller/main_test.go
Migration tests verify preservation of other status fields, conflict handling when status changes concurrently, and successful retry with a fresh read.
Revision completion status patch
internal/operator-controller/applier/boxcutter.go, internal/operator-controller/applier/boxcutter_test.go
ensureRevisionStatus patches CompletedAt with optimistic locking instead of updating the full status. Tests expect status-subresource patches and include resource versions in relevant fixtures.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: fao89

Merge Risk: Minimal · up to 2fc00

This change makes the ClusterObjectSet cache keep the same reduced fields for every object. It also changes revision completion so it no longer overwrites other status data. The change is small and covered by targeted tests. I found no actionable merge-blocking issue.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: removing owner-name-dependent retention from the ClusterObjectSet cache transform. It uses the 🌱 prefix that the repository template requires. It is short and specific…
Description check Passed The description follows the repository template. It has the required '# Description' section with a clear summary and motivation. It includes the Reviewer Checklist. It also adds a validation section …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: removing owner-name-dependent retention from the ClusterObjectSet cache transform. It uses the 🌱 prefix that the repository template requires. It is short and specific, so a reviewer scanning history can tell what changed.

Full details: Description check

Explanation

The description follows the repository template. It has the required '# Description' section with a clear summary and motivation. It includes the Reviewer Checklist. It also adds a validation section that lists the commands run and states that live E2E was not run. The checklist items are unchecked, which is acceptable because they are reviewer items. The description does not link a related GitHub issue, but the template treats that item as a checklist item, not a required field.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 8afe84fe-5842-4f8b-8a27-fca9b28e71d6
Commits

Reviewing files that changed from the base of the PR and between 7a8abf4 and 2fc0078.

Files selected for processing: 1

  • cmd/operator-controller/main_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Apply the reduced ClusterObjectSet cache representation uniformly, regardless of owner labels, while preserving revision discovery, completion evidence, and existing metadata handling.

Patch only completedAt during Helm migration with optimistic resourceVersion locking so writes from trimmed cache reads preserve detailed status and reject concurrent updates. Add coverage for label independence, status preservation, conflicts, and subsequent reconciliation.

Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
@perdasilva
perdasilva force-pushed the refactor/remove-cod-cos-owner-labels branch from 7a8abf4 to 2fc0078 Compare November 17, 2026 07:56
@perdasilva

Copy link
Copy Markdown
Contributor Author

/hold while we decide whether we really want to do this

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 17, 2026

This branch has not been deployed

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

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant