Skip to content

✨ OPRUN-4850: Introduce the initial ClusterObjectSlice API - #3195

Draft
fao89 wants to merge 3 commits into
operator-framework:mainfrom
fao89:oprun-4850-clusterobjectslice-api
Draft

fao89 wants to merge 3 commits into
operator-framework:mainfrom
fao89:oprun-4850-clusterobjectslice-api

Conversation

@fao89

@fao89 fao89 commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Description

Start the OPRUN-4850 design discussion with documentation and an initial experimental ClusterObjectSlice API for storing rendered manifests independently of rollout intent. Existing inline and Secret-backed content paths continue to work as they do today.

  • Document the motivation, representation tradeoffs, responsibility boundaries, reviewer decisions, and admission scenarios.
  • Introduce an immutable, cluster-scoped API with explicit object identities and JSON/GzipJSON payloads. Schema and CEL validate the storage envelope; payload parsing, decompression, and identity comparison remain follow-up work.
  • Generate the CRD, apply configurations, and API reference, wire the CRD into experimental installations, and cover admission behavior with API tests.

This draft is a conversation starter. Readable manifests, deeper admission validation, COD/COS references, digests, and retention coordination remain open for incremental proposals. Creating a slice stores content without applying objects or reporting rollout readiness.

Documentation is in one commit, followed by separate commits for API source/tests and generated code/manifests.

Related issue: https://redhat.atlassian.net/browse/OPRUN-4850

Validation

  • make test-unit
  • API and object-controller manifest tests after the entry type rename
  • make lint lint-helm
  • make lint-api-diff — no new issues; 32 pre-existing issues
  • make verify
  • Commit hooks and whitespace checks

Reviewer Checklist

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

Always review AI generated responses prior to use.
AI-assisted response via openshift-developer plugin

@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 Nov 19, 2026
@netlify

netlify Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

👷 Deploy request for olmv1 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 538f69c

@openshift-ci

openshift-ci Bot commented Nov 19, 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 pedjak 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 19, 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

// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:XValidation:rule=`self.matches('^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$')`,message="kind must start with a letter and contain only letters, digits, or hyphens, ending with an alphanumeric character"
Kind string `json:"kind,omitempty"`

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.

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.

@joelanford how do you feel about this?

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.

That's for object references? Not the actual object definition?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The linked convention applies to references to API resources. These entries store manifest content, with an identity header describing the object inside the payload, so I kept apiVersion and kind. This lets publishers describe the manifest directly without mapping its GVK to a REST resource through discovery. The current API validates the envelope only; comparing the decoded payload with that header remains follow-up work.

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.

I think we need to know how object-controller uses these fields in order to decide if they are references. Do we have a matching PR that incorporates and uses this API yet?

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.

fwiw, I landed on APIVersion and Kind in my orb-operator prototype: https://github.com/joelanford/orb-operator/blob/76c7c2316efdacf9a3eeb8a68719df9781dacf1e/api/v1alpha1/types_clusterobjectslice.go#L50-L65

But that might be because I was speed-running it. I'll find my orb-operator usage of it to see if we ever need to translate it to GVR.

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.

All I can find in orb-operator is that we need a key that matches between the phase defintion's reference and the COSL's object key. This could literally be whatever we want it to be as long as uniqueness is guaranteed per object.

So I think APIVersion/Kind/Name/Namespace and Group/Resource/Kind/Name/Namespace both equally satisfy that requirement.

Comment on lines 81 to +82
require.Equal(t, tc.wantObjectController, objects["CustomResourceDefinition/clusterobjectsets.olm.operatorframework.io"] != nil)
require.Equal(t, tc.wantObjectController, objects["CustomResourceDefinition/clusterobjectslices.olm.operatorframework.io"] != nil)

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.

It appears the cluserobjectdeployments is missing from this list?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Added the missing ClusterObjectDeployment CRD assertion alongside the ClusterObjectSet and ClusterObjectSlice checks. It verifies presence or absence according to wantObjectController across all chart configurations in the test.

Start the OPRUN-4850 discussion with a minimal content-storage contract,
validation boundaries, ownership expectations, and incremental follow-ups.
Include the generated API reference alongside the design document.

Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Introduce experimental immutable manifest storage with ClusterObjectSliceEntry
values. Validate the envelope through schema and CEL rules and add API tests
and experimental chart wiring. Deep payload admission, consumer integration,
and retention remain separate follow-ups for OPRUN-4850.

Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Generate the experimental CRD, deep-copy methods, apply configurations,
and experimental installation manifests from the initial ClusterObjectSlice
API definition. The generated API reference is in the documentation commit.

Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@fao89
fao89 force-pushed the oprun-4850-clusterobjectslice-api branch from 9d3bec8 to 538f69c Compare November 25, 2026 14:59
perdasilva pushed a commit to perdasilva/operator-controller that referenced this pull request Nov 26, 2026
Copy the ClusterObjectSlice Go types from operator-framework#3195 into tmp so the GA
shape review covers the slice API alongside the ClusterObjectSet
objectSliceRef that consumes it. Cross-reference the entry identity
fields from ObjectSliceEntryRef to ClusterObjectSliceEntry.

Signed-off-by: Per G. da Silva <pegoncal@redhat.com>
perdasilva pushed a commit to perdasilva/operator-controller that referenced this pull request Nov 26, 2026
Add complete Go API type definitions under tmp/ for the proposed GA
shape of ClusterObjectDeployment, ClusterObjectSet, ClusterExtension,
and ClusterObjectSlice, for review in its entirety rather than as a
diff against the current types.

ClusterObjectSet:
- Group the object counts under status.objectCounts (total, present,
  synced, superseded, colliding); drop the health counts.
- Replace status.observedPhases with status.phases: pinned
  contentDigest, lifecycle status, machine-readable reason, and sparse
  per-object diagnostics categorized by reason; object entries are
  identified by apiVersion, kind, name, and namespace, matching the
  spec's object references.
- Replace secretRef object sources with objectSliceRef: a slice name
  plus entry identity selecting a manifest in a cluster-scoped
  ClusterObjectSlice.
- Per-object progressionProbes supporting ConditionEqual and CEL
  rules; conditions and phase-status documentation use progression
  probes terminology and kind-scoped reason constants.
- Mark the phase status, reason, message, and lastTransitionTime
  fields experimental; the standard channel omits them.

ClusterObjectDeployment:
- Rename the Available condition to Ready, defined around the active
  revision's own Ready condition: True when the single active revision
  is Ready, False when it is not or no active revision is controlled,
  Unknown while more than one active revision exists or readiness is
  undetermined.

ClusterExtension:
- Mirror the managing ClusterObjectDeployment's Ready condition in
  place of Available.
- Document the serviceAccount field's historic role and fail-open
  behavior.
- Retain spec.config, spec.progressDeadlineMinutes, and
  status.install.bundle.release as experimental.

ClusterObjectSlice (started from operator-framework#3195, reworked):
- Spec is a discriminated union with a single content type,
  InlineManifests, whose manifests list stores embedded Kubernetes
  manifests inline, each carrying its own target identity.

Signed-off-by: Per G. da Silva <pegoncal@redhat.com>

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/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.

4 participants