Skip to content

[DRAFT] Simplify operator config by defaulting to OSSM#115

Draft
mkolesnik wants to merge 1 commit into
stolostron:mainfrom
mkolesnik:ocp-only-spokes
Draft

[DRAFT] Simplify operator config by defaulting to OSSM#115
mkolesnik wants to merge 1 commit into
stolostron:mainfrom
mkolesnik:ocp-only-spokes

Conversation

@mkolesnik

Copy link
Copy Markdown
Contributor

Removes platform branching from the controller.
Kubebuilder defaults now set OSSM values at admission time, so the controller reads spec.operator directly.
Users can override all fields to use a different operator (e.g. Sail on Kind for dev/testing).

Depends-On: #114

@openshift-ci

openshift-ci Bot commented Jun 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

@mkolesnik

Copy link
Copy Markdown
Contributor Author

/hold
Depends on #114

@openshift-ci

openshift-ci Bot commented Jun 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mkolesnik

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

@mkolesnik mkolesnik changed the title Simplify operator config by defaulting to OSSM [DRAFT] Simplify operator config by defaulting to OSSM Jun 4, 2026
@mkolesnik

Copy link
Copy Markdown
Contributor Author

/test all

@mkolesnik

Copy link
Copy Markdown
Contributor Author

/retest

@mkolesnik

mkolesnik commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR removes platform/product-claim–based operator selection from the MultiClusterMesh controller. OperatorConfig gains a new Name field (with kubebuilder defaults) that directly supplies the operator package name; ReasonMissingProductClaim is removed. The controller drops applyOperatorDefaults, getProductClaim, and all OCP/Kubernetes-specific exported constants, replacing them with a single BuiltinOperatorNamespace constant. buildOperatorManifestWork and peer-conflict validation now use mesh.Spec.Operator directly. Tests replace CreateK8sManagedCluster/CreateOCPManagedCluster with a unified helper and remove the "Platform detection" table. Documentation reflects OSSM as the explicit default.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 8 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Integration test test/integration/controller_test.go lacks explicit timeouts on async operations. Lines 218-224 and 241-247 have Eventually() calls without timeout/interval parameters (e.g., `Eve... Add explicit timeout/interval parameters to all Eventually() calls and include meaningful failure messages in assertions, per the review comment suggesting: Eventually(..., 30*time.Second, 1*time.Second).Should(Equal(...)).
✅ Passed checks (8 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main objective: simplifying operator config by defaulting to OSSM, which aligns with the core changes removing platform branching.
Description check ✅ Passed The description directly relates to the changeset, explaining the removal of platform branching and how Kubebuilder defaults enable simplified controller logic.
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.
Stable And Deterministic Test Names ✅ Passed All 60 test declarations (It, Describe, Context, When, PIt) in modified test files contain only static string literals. No prohibited patterns detected: no generated suffixes, timestamps, UUIDs, IP...
No-Weak-Crypto ✅ Passed No weak crypto (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or non-constant-time secret comparisons detected in changed files.
Container-Privileges ✅ Passed No privileged container configurations found. Deployment has allowPrivilegeEscalation: false, runs as non-root, drops all capabilities, and enforces read-only filesystem with seccomp profile.
No-Sensitive-Data-In-Logs ✅ Passed No logging statements expose sensitive data. Operator config fields (Source, SourceNamespace, Name, Channel) are never logged; they're only used in manifest construction.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@stolostron stolostron deleted a comment from coderabbitai Bot Jun 16, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@test/integration/controller_test.go`:
- Around line 218-224: The Eventually assertions used in the async checks (the
Eventually block at the specified location and other similar blocks) rely on
implicit default timeout and polling interval values, making the test behavior
non-deterministic under CI load. Add explicit timeout and polling interval
parameters to all Eventually calls in the async assertion blocks. Specify these
parameters using Eventually's configuration options to ensure consistent and
predictable test timing behavior across different environments. This applies to
the Eventually block shown in the diff and any other similar Eventually calls in
async assertion patterns throughout the test file.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 468b434d-024a-4b7c-b584-8bd208749983

📥 Commits

Reviewing files that changed from the base of the PR and between f335754 and 0fa1113.

📒 Files selected for processing (6)
  • docs/design.md
  • pkg/apis/mesh/v1alpha1/types.go
  • pkg/hub/mesh/controller.go
  • test/e2e/mesh_lifecycle_test.go
  • test/integration/controller_test.go
  • test/util/ocm.go

Comment thread test/integration/controller_test.go Outdated
Remove platform branching from the controller. Kubebuilder defaults
now set OSSM values at admission time, so the controller just reads
spec.operator directly without computing per-platform defaults.

This eliminates applyOperatorDefaults, product claim gating, and all
the OCP/K8s constant pairs. Users can still override all fields to
use a different operator (e.g. Sail on Kind for dev/testing).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Mike Kolesnik <mkolesni@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant