Skip to content

✨ add ClusterObjectDeployment controller skeleton - #3032

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
perdasilva:cod-controller-skeleton
Oct 20, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
perdasilva:cod-controller-skeleton

Conversation

@perdasilva

@perdasilva perdasilva commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

Lays the foundation for the ClusterObjectDeployment (COD) controller in the object-controller binary, following the existing ClusterObjectSet (COS) controller patterns. The COD API types were introduced in #3018; this PR adds the controller that will reconcile ClusterObjectDeployment objects and own ClusterObjectSets.

No reconciliation behavior is implemented yet — this is intentionally just the skeleton so behavior can be layered on in follow-ups.

What's included

  • ClusterObjectDeploymentReconciler with a no-op Reconcile and +kubebuilder:rbac markers, gated by the experimental-only //go:build !standard tag (mirroring COS).
  • SetupWithManager that:
    • For ClusterObjectDeployment,
    • Owns(&ClusterObjectSet{}) for already-owned revisions, and
    • Watches(&ClusterObjectSet{}) mapping spec.group → ClusterObjectDeployment name, so not-yet-adopted (orphan) ClusterObjectSets also enqueue their COD. This mirrors the reference orb-operator COD controller and pre-wires future adoption behavior.
    • Unlike COS — which watches arbitrary child GVKs dynamically via the managedcache TrackingCache — COD owns a known child type, so plain controller-runtime watches are the natural fit.
  • COD types registered in the object-controller scheme (internal/object-controller/scheme).
  • Reconciler wired into the manager and ClusterObjectDeployment added to the manager cache (cmd/object-controller/main.go).
  • Unit tests covering reconcile of present/absent objects and the spec.group → COD mapping.

Notes

  • No new RBAC role YAML is rendered: the object-controller ServiceAccount binds to cluster-admin, so the markers are forward-looking/documentary here (consistent with COS).
  • make generate and make manifests produce no diff: COD deepcopy/applyconfig/CRD already exist from ✨ OPRUN-4786: Add ClusterObjectDeployment API and admission validation #3018, and COD is an experimental-channel-only CRD.

Testing

  • go test ./internal/object-controller/... passes (incl. new tests).
  • golangci-lint clean, go vet clean, gofmt clean.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added the experimental, cluster-scoped ClusterObjectDeployment API, available with the cod short name.
    • Deployments support phased templates containing inline objects or Secret references, collision protection, progression probes, and rollout status.
    • Added controller support to monitor deployments and associated ClusterObjectSet resources through configured groups.
    • Deployment resources are now available when the object controller is enabled.
  • Tests
    • Added coverage for deployment handling and cluster object set association scenarios.

@netlify

netlify Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit e96a5f8
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/6ad72990b08ba5290727db46
😎 Deploy Preview https://deploy-preview-3032--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 0a2d2a1f-5ec4-4d0f-853a-dd1d27aafb04
📥 Commits

Reviewing files that changed from the base of the PR and between 0335f59 and e96a5f8.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 4d6a4d23-28f3-46c1-85ee-bec36bf172d0
📥 Commits

Reviewing files that changed from the base of the PR and between 5d2f333 and 0335f59.

📒 Files selected for processing: 3
  • helm/olmv1/templates/crds/customresourcedefinition-clusterobjectdeployments.olm.operatorframework.io.yml
  • manifests/experimental-e2e.yaml
  • manifests/experimental.yaml

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

📝 Walkthrough

The change adds the ClusterObjectDeployment CRD and Helm rendering, registers its types with the object controller, and starts a skeleton reconciler that watches deployments and related ClusterObjectSet resources.

Changes: ClusterObjectDeployment API and controller

Layer / File(s) Summary
Define deployment resource contract
manifests/experimental*.yaml, helm/olmv1/templates/crds/*clusterobjectdeployments*
The manifests define the cluster-scoped API, template and probe validation, rollout status conditions, naming rules, and status subresource. Helm renders the CRD when objectController.enabled is true.
Implement deployment reconciler
internal/object-controller/scheme/scheme.go, internal/object-controller/controllers/clusterobjectdeployment_controller.go, internal/object-controller/controllers/*test.go
The scheme registers deployment types. The reconciler fetches requested deployments, treats not-found errors as successful no-ops, watches related resources, and maps eligible ClusterObjectSet objects to deployment requests.
Register reconciler with manager
cmd/object-controller/main.go
The manager cache watches both resource types and registers the ClusterObjectDeploymentReconciler.

Priority: ➖ Normal

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ManagerCache
  participant ClusterObjectDeploymentReconciler
  participant KubernetesAPI
  ManagerCache->>ClusterObjectDeploymentReconciler: Send reconcile request after watched resource changes
  ClusterObjectDeploymentReconciler->>KubernetesAPI: Fetch requested ClusterObjectDeployment
  KubernetesAPI-->>ClusterObjectDeploymentReconciler: Return deployment or not-found
Loading
Merge Risk: ⚪ Minimal · up to 0335f

This update packages the experimental ClusterObjectDeployment resource definition so it is installed alongside the object controller, which the controller needs to start correctly. No outstanding defects were identified, and the change is ready to merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. (3 skipped: 3… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title is concise, uses the required ✨ prefix, and clearly identifies the main change: adding the ClusterObjectDeployment controller skeleton.
Description check Passed The description clearly explains the purpose, scope, implementation details, related issue, and testing. It is mostly complete against the template, although it does not reproduce the Reviewer Checkli…
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: Description check

Explanation

The description clearly explains the purpose, scope, implementation details, related issue, and testing. It is mostly complete against the template, although it does not reproduce the Reviewer Checklist section.

Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Lay the foundation for the ClusterObjectDeployment (COD) controller in the
object-controller binary, following the ClusterObjectSet (COS) controller
patterns. The COD API types were introduced in operator-framework#3018; this adds the controller
that will reconcile ClusterObjectDeployment objects and own ClusterObjectSets.
No reconciliation behavior is implemented yet.

- Add ClusterObjectDeploymentReconciler with a no-op Reconcile and RBAC markers,
  gated by the experimental-only //go:build !standard tag.
- SetupWithManager watches ClusterObjectDeployment and Owns ClusterObjectSet,
  plus a Watches mapping a ClusterObjectSet's spec.group to its owning
  ClusterObjectDeployment so not-yet-adopted (orphan) revisions are also
  surfaced.
- Register the COD types in the object-controller scheme and wire the reconciler
  into the manager, adding ClusterObjectDeployment to the manager cache.
- Ship the ClusterObjectDeployment CRD in the experimental manifests via a Helm
  CRD wrapper. The base CRD existed (from operator-framework#3018) but was never rendered into the
  chart, so the manager could not start an informer for the type
  (ReaderFailOnMissingInformer: true) and the object-controller deployment never
  became ready.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
@perdasilva
perdasilva force-pushed the cod-controller-skeleton branch from 0335f59 to e96a5f8 Compare October 20, 2026 08:42

@fao89 fao89 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Oct 20, 2026

@fgiudici fgiudici left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@perdasilva

Copy link
Copy Markdown
Contributor Author

adding approval after two lgtms

@perdasilva perdasilva added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 20, 2026
@openshift-ci

openshift-ci Bot commented Oct 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

The pull request process is described 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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 09a7363 into operator-framework:main Oct 20, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants