feat:Add gateway and Gateway-class for llmd#2529
Conversation
Signed-off-by: Milind Waykole <mwaykole@redhat.com>
WalkthroughAdds three new resource classes: a cluster-scoped GatewayClass and a namespaced Gateway for the gateway.networking.k8s.io API group, plus a namespaced Gateway for networking.istio.io. Also adds a new ApiGroup constant GATEWAY_NETWORKING_K8S_IO. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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. Comment |
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
ocp_resources/gateway_networking_istio_io.py (2)
4-6: Import MissingRequiredArgumentError used by the new validation.from typing import Any from ocp_resources.resource import NamespacedResource +from ocp_resources.exceptions import MissingRequiredArgumentError
9-12: Improve class docstring for clarity.- """ - No field description from API - """ + """ + Istio Gateway (networking.istio.io) wrapper. + Required: spec.servers (non-empty). Optional: spec.selector. + """
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
ocp_resources/gateway_class.py(1 hunks)ocp_resources/gateway_gateway_networking_k8s_io.py(1 hunks)ocp_resources/gateway_networking_istio_io.py(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
ocp_resources/gateway_class.py (4)
ocp_resources/resource.py (1)
Resource(446-1530)ocp_resources/exceptions.py (1)
MissingRequiredArgumentError(5-10)ocp_resources/gateway_gateway_networking_k8s_io.py (1)
to_dict(165-185)ocp_resources/gateway_networking_istio_io.py (1)
to_dict(33-44)
ocp_resources/gateway_networking_istio_io.py (2)
ocp_resources/resource.py (2)
NamespacedResource(1533-1643)ApiGroup(466-575)ocp_resources/gateway_gateway_networking_k8s_io.py (2)
Gateway(9-187)to_dict(165-185)
ocp_resources/gateway_gateway_networking_k8s_io.py (4)
ocp_resources/resource.py (2)
NamespacedResource(1533-1643)ApiGroup(466-575)ocp_resources/exceptions.py (1)
MissingRequiredArgumentError(5-10)ocp_resources/gateway_networking_istio_io.py (2)
Gateway(8-46)to_dict(33-44)ocp_resources/gateway_class.py (1)
to_dict(70-86)
🔇 Additional comments (3)
ocp_resources/gateway_gateway_networking_k8s_io.py (1)
175-186: LGTM on spec construction.Field names (gatewayClassName, listeners, addresses, infrastructure) align with Gateway API; conditional inclusion is correct.
ocp_resources/gateway_class.py (1)
70-87: Overall structure looks good.Base to_dict usage and optional fields (description, parametersRef) are handled correctly.
ocp_resources/gateway_networking_istio_io.py (1)
13-13: No action required — apiVersion is resolved at runtime.NETWORKING_ISTIO_IO == "networking.istio.io" and Resource._get_api_version / _find_supported_resource dynamically select a supported apiVersion at runtime (ocp_resources/resource.py: lines 68–74, 77–80, 856–862).
Signed-off-by: Milind Waykole <mwaykole@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
ocp_resources/resource.py (1)
495-495: Gateway API group constant added — verified; one hardcoded finalizer remains
- GATEWAY_NETWORKING_K8S_IO is defined at ocp_resources/resource.py:495 and is used (api_group) in ocp_resources/gateway_class.py (line ~30) and ocp_resources/gateway_gateway_networking_k8s_io.py (line ~15).
- ocp_resources/gateway_class.py still contains the hardcoded finalizer "gateway-exists-finalizer.gateway.networking.k8s.io" (lines ~21–25). Centralize this (use the ApiGroup constant or a FINALIZER constant) to avoid duplicate literals.
- No occurrences of legacy "networking.x-k8s.io" found.
Optional nit (consistency):
- GATEWAY_NETWORKING_K8S_IO = "gateway.networking.k8s.io" + GATEWAY_NETWORKING_K8S_IO: str = "gateway.networking.k8s.io"
Signed-off-by: Milind Waykole <mwaykole@redhat.com>
|
/verified |
|
/approve |
|
/verified |
Short description:
More details:
What this PR does / why we need it:
Which issue(s) this PR fixes:
Special notes for reviewer:
Bug:
Summary by CodeRabbit
New Features
Chores
Bug Fixes