Skip to content

Conversation

@zhiweiyin318
Copy link
Member

@zhiweiyin318 zhiweiyin318 commented Nov 10, 2025

Summary

Related issue(s)

Fixes #

Summary by CodeRabbit

  • New Features

    • Endpoint exposure now supports loadBalancer and route types in addition to hostname for both gRPC and HTTPS endpoints.
    • New per-type options allow providing an explicit host and CA bundle for loadBalancer and route exposures.
    • Host field is optional for endpoint configurations, permitting empty host when using non-hostname exposure types.
  • Documentation

    • Clarified descriptions for hostname, caBundle, and host to reflect customized CA usage and optional host behavior.

@openshift-ci openshift-ci bot requested review from jnpacker and qiujian16 November 10, 2025 07:59
@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

CRD OpenAPI schema and Go API types were updated to add two new endpoint exposure types (loadBalancer, route) for grpc and https, add corresponding LoadBalancer/Route config structs, extend enums, and update deepcopy methods and descriptions.

Changes

Cohort / File(s) Summary
CRD Schema
operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml
OpenAPI v3 schema edits under spec.serverConfiguration.endpointsExposure.items for both grpc and https: expanded type.enum to include loadBalancer and route; added loadBalancer and route object blocks with host and caBundle; updated descriptions for hostname, host, and caBundle.
Go types & constants
operator/v1/types_clustermanager.go
Added EndpointTypeLoadBalancer and EndpointTypeRoute constants; added LoadBalancerConfig and RouteConfig structs (fields: Host, CABundle); extended Endpoint to include LoadBalancer *LoadBalancerConfig and Route *RouteConfig; expanded valid EndpointExposureType enum to include new values.
Deepcopy implementations
operator/v1/zz_generated.deepcopy.go
Added DeepCopyInto/DeepCopy methods for new LoadBalancerConfig and RouteConfig; updated Endpoint deepcopy logic to copy new fields when non‑nil.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus review on:
    • CRD schema enum/descriptions matching Go enum names and JSON structure.
    • Correctness of new struct JSON tags and omitempty semantics.
    • DeepCopy implementations properly handling nil vs non-nil for new pointer fields.

Possibly related PRs

Suggested labels

lgtm

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is completely empty except for the template boilerplate, with both the Summary and Related issue(s) sections left blank, providing no context for the changes made. Add a detailed summary explaining the new endpoint exposure types (loadBalancer and route), their purpose, and which files were modified. Link any related issues and provide implementation context.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: updating endpoint configurations for endpointsExposure in serverConfiguration, which matches the file modifications and addition of new endpoint exposure types (loadBalancer and route).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0b783f and e5fed78.

📒 Files selected for processing (3)
  • operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml (2 hunks)
  • operator/v1/types_clustermanager.go (2 hunks)
  • operator/v1/zz_generated.deepcopy.go (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-02T11:59:50.703Z
Learnt from: qiujian16
Repo: open-cluster-management-io/api PR: 392
File: operator/v1/types_clustermanager.go:178-195
Timestamp: 2025-09-02T11:59:50.703Z
Learning: XValidation markers in kubebuilder require Kubernetes 1.25+ and should not be added to the open-cluster-management-io/api project until minimum Kubernetes version requirements are established to avoid breaking compatibility with older clusters.

Applied to files:

  • operator/v1/types_clustermanager.go
🧬 Code graph analysis (1)
operator/v1/zz_generated.deepcopy.go (1)
operator/v1/types_clustermanager.go (2)
  • LoadBalancerConfig (230-238)
  • RouteConfig (241-249)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit
  • GitHub Check: verify

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
operator/v1/types_clustermanager.go (1)

205-208: Consider the naming mismatch between field name and usage.

The hostname field (type *HostnameConfig) is now used for loadBalancer and route endpoint types, not just hostname. While renaming would be a breaking change, consider documenting this broader usage more explicitly or planning a future API version that uses a more generic field name like config or endpointConfig.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a8652dd and ca11ed9.

📒 Files selected for processing (2)
  • operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml (4 hunks)
  • operator/v1/types_clustermanager.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: verify
🔇 Additional comments (3)
operator/v1/types_clustermanager.go (1)

228-234: LGTM!

The new EndpointTypeLoadBalancer and EndpointTypeRoute constants are well-defined and follow the existing naming conventions.

operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml (2)

597-628: HTTPS endpoint configuration is consistent with gRPC.

The HTTPS endpoint schema correctly mirrors the gRPC endpoint structure with the same field definitions, descriptions, and enum values. This consistency is good for API usability.


565-596: Verified: CRD schema correctly reflects Go types but validation ambiguity confirmed.

The review comment is accurate. Verification confirms:

  • CRD consistency: The schema matches the Go struct definitions in operator/v1/types_clustermanager.go
  • Validation ambiguity confirmed: The Host field in HostnameConfig struct is marked +optional (line 211), yet its description states "Host must be set if the type is hostname" (line 218-219)
  • No enforcement found: No CEL validation rules or webhook validators were found to enforce the conditional requirement at runtime

The API will accept requests where type=hostname but host is empty, creating potential runtime errors. This inherited issue from the Go types has been accurately captured in the CRD schema without resolution.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
operator/v1/types_clustermanager.go (1)

210-220: Consider renaming HostnameConfig to better reflect its broader scope.

The struct name HostnameConfig is now misleading since this configuration applies to all endpoint types (hostname, loadBalancer, route), not just hostname. A more accurate name like EndpointConfig or EndpointHostConfig would better convey its purpose across all exposure types.

While the Host field description has been improved with softer language ("should be set" instead of "must be set"), the struct name still suggests hostname-specific usage, which may confuse API users.

Based on learnings (this concern was previously raised in past reviews).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca11ed9 and 3356518.

📒 Files selected for processing (2)
  • operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml (4 hunks)
  • operator/v1/types_clustermanager.go (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-02T11:59:50.703Z
Learnt from: qiujian16
Repo: open-cluster-management-io/api PR: 392
File: operator/v1/types_clustermanager.go:178-195
Timestamp: 2025-09-02T11:59:50.703Z
Learning: XValidation markers in kubebuilder require Kubernetes 1.25+ and should not be added to the open-cluster-management-io/api project until minimum Kubernetes version requirements are established to avoid breaking compatibility with older clusters.

Applied to files:

  • operator/v1/types_clustermanager.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: unit
  • GitHub Check: verify
🔇 Additional comments (3)
operator/v1/types_clustermanager.go (1)

229-234: LGTM!

The new endpoint exposure type constants are well-defined with clear comments and consistent naming.

operator/v1/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml (2)

569-596: LGTM!

The gRPC endpoint schema updates correctly reflect the Go type changes:

  • Extended enum to include loadBalancer and route
  • Updated descriptions for hostname, caBundle, and host fields
  • Removed the required constraint on the host field, aligning with the +optional marker in the Go struct

600-628: LGTM!

The HTTPS endpoint schema updates mirror the gRPC endpoint changes and maintain consistency across both endpoint types. The extended enum and updated field descriptions properly reflect the broadened endpoint exposure options.

@qiujian16
Copy link
Member

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 12, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16, zhiweiyin318

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

The pull request process is described here

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

@skeeey
Copy link
Member

skeeey commented Nov 12, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Nov 12, 2025
@openshift-merge-bot openshift-merge-bot bot merged commit 3e1bb92 into open-cluster-management-io:main Nov 12, 2025
12 checks passed
@zhiweiyin318 zhiweiyin318 deleted the grpc-config branch November 12, 2025 05:06
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.

3 participants