Skip to content

feat:Add gateway and Gateway-class for llmd#2529

Merged
myakove merged 3 commits into
RedHatQE:mainfrom
mwaykole:llmdc
Sep 16, 2025
Merged

feat:Add gateway and Gateway-class for llmd#2529
myakove merged 3 commits into
RedHatQE:mainfrom
mwaykole:llmdc

Conversation

@mwaykole

@mwaykole mwaykole commented Sep 15, 2025

Copy link
Copy Markdown
Contributor
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

    • Support for GatewayClass resources (controller, description, parameters).
    • Support for Gateway resources for the Gateway API (gateway class, listeners, addresses, infrastructure).
    • Support for Gateway resources for Istio (selector and servers).
  • Chores

    • Added Gateway networking API group identifier.
  • Bug Fixes

    • Improved validation with clearer errors for missing required fields and consistent spec generation.

Signed-off-by: Milind Waykole <mwaykole@redhat.com>
@coderabbitai

coderabbitai Bot commented Sep 15, 2025

Copy link
Copy Markdown

Walkthrough

Adds 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

Cohort / File(s) Summary of changes
GatewayClass & Gateway (gateway.networking.k8s.io)
ocp_resources/gateway_class.py, ocp_resources/gateway_gateway_networking_k8s_io.py
Added GatewayClass (cluster-scoped Resource) and Gateway (NamespacedResource) targeting gateway.networking.k8s.io. Both implement __init__ to store inputs and to_dict() to construct spec; GatewayClass.to_dict() enforces controller_name, Gateway.to_dict() enforces gateway_class_name and listeners.
Istio Gateway
ocp_resources/gateway_networking_istio_io.py
Added Gateway (NamespacedResource) for networking.istio.io with __init__ (selector, servers) and to_dict() to populate spec when fields provided.
API group constants
ocp_resources/resource.py
Added ApiGroup.GATEWAY_NETWORKING_K8S_IO = "gateway.networking.k8s.io" constant to ApiGroup.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • myakove
  • rnetser

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is empty and contains only the repository template headings with no filled content, so required sections such as "Short description", "What this PR does / why we need it", and "Which issue(s) this PR fixes" are missing. With the template unpopulated, reviewers cannot assess motivation, scope, testing, or breaking-change implications of the new resources. Therefore the PR description fails the repository's required template and is not sufficient for review. Please populate the template: provide a concise "Short description", a "More details" list of the primary file changes and behavior, and a clear "What this PR does / why we need it" including any backward-compatibility or migration notes; add the related issue number(s) under "Which issue(s) this PR fixes" and any "Special notes for reviewer" such as required tests or configuration. Also indicate test coverage and CI results or commands to reproduce, and call out any potential breaking changes or required cluster/version constraints. Once these fields are completed reviewers can more easily verify intent and merge readiness.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title "feat:Add gateway and Gateway-class for llmd" succinctly identifies the primary change — adding gateway-related resources (Gateway and GatewayClass) — and aligns with the files added in the changeset. It is concise and specific enough for a reviewer scanning history to understand the main intent, though it contains minor formatting issues (extra space and the colon after "feat") and inconsistent capitalization. These issues are cosmetic and do not make the title misleading. Therefore the title meets the repository's criteria for summarizing the main change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 592bdd1 and 1532739.

📒 Files selected for processing (1)
  • ocp_resources/resource.py (1 hunks)

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

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

@redhat-qe-bot

Copy link
Copy Markdown
Contributor

Report bugs in Issues

Welcome! 🎉

This pull request will be automatically processed with the following features:

🔄 Automatic Actions

  • Reviewer Assignment: Reviewers are automatically assigned based on the OWNERS file in the repository root
  • Size Labeling: PR size labels (XS, S, M, L, XL, XXL) are automatically applied based on changes
  • Issue Creation: A tracking issue is created for this PR and will be closed when the PR is merged or closed
  • Pre-commit Checks: pre-commit runs automatically if .pre-commit-config.yaml exists
  • Branch Labeling: Branch-specific labels are applied to track the target branch
  • Auto-verification: Auto-verified users have their PRs automatically marked as verified

📋 Available Commands

PR Status Management

  • /wip - Mark PR as work in progress (adds WIP: prefix to title)
  • /wip cancel - Remove work in progress status
  • /hold - Block PR merging (approvers only)
  • /hold cancel - Unblock PR merging
  • /verified - Mark PR as verified
  • /verified cancel - Remove verification status

Review & Approval

  • /lgtm - Approve changes (looks good to me)
  • /approve - Approve PR (approvers only)
  • /automerge - Enable automatic merging when all requirements are met (maintainers and approvers only)
  • /assign-reviewers - Assign reviewers based on OWNERS file
  • /assign-reviewer @username - Assign specific reviewer
  • /check-can-merge - Check if PR meets merge requirements

Testing & Validation

  • /retest tox - Run Python test suite with tox
  • /retest python-module-install - Test Python package installation
  • /retest conventional-title - Validate commit message format
  • /retest all - Run all available tests

Container Operations

  • /build-and-push-container - Build and push container image (tagged with PR number)
    • Supports additional build arguments: /build-and-push-container --build-arg KEY=value

Cherry-pick Operations

  • /cherry-pick <branch> - Schedule cherry-pick to target branch when PR is merged
    • Multiple branches: /cherry-pick branch1 branch2 branch3

Label Management

  • /<label-name> - Add a label to the PR
  • /<label-name> cancel - Remove a label from the PR

✅ Merge Requirements

This PR will be automatically approved when the following conditions are met:

  1. Approval: /approve from at least one approver
  2. LGTM Count: Minimum 0 /lgtm from reviewers
  3. Status Checks: All required status checks must pass
  4. No Blockers: No WIP, hold, or conflict labels
  5. Verified: PR must be marked as verified (if verification is enabled)

📊 Review Process

Approvers and Reviewers

Approvers:

  • myakove
  • rnetser

Reviewers:

  • dbasunag
  • myakove
  • rnetser
Available Labels
  • hold
  • verified
  • wip
  • lgtm
  • approve
  • automerge

💡 Tips

  • WIP Status: Use /wip when your PR is not ready for review
  • Verification: The verified label is automatically removed on each new commit
  • Cherry-picking: Cherry-pick labels are processed when the PR is merged
  • Container Builds: Container images are automatically tagged with the PR number
  • Permission Levels: Some commands require approver permissions
  • Auto-verified Users: Certain users have automatic verification and merge privileges

For more information, please refer to the project documentation or contact the maintainers.

Comment thread ocp_resources/gateway_class.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 42a63d4 and 222b594.

📒 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).

Comment thread ocp_resources/gateway_class.py
Comment thread ocp_resources/gateway_class.py
Comment thread ocp_resources/gateway_gateway_networking_k8s_io.py
Comment thread ocp_resources/gateway_gateway_networking_k8s_io.py
Comment thread ocp_resources/gateway_networking_istio_io.py
Signed-off-by: Milind Waykole <mwaykole@redhat.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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"
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 222b594 and 592bdd1.

📒 Files selected for processing (1)
  • ocp_resources/resource.py (1 hunks)

Comment thread ocp_resources/resource.py Outdated
Signed-off-by: Milind Waykole <mwaykole@redhat.com>
@mwaykole

Copy link
Copy Markdown
Contributor Author

/verified

@myakove

myakove commented Sep 16, 2025

Copy link
Copy Markdown
Collaborator

/approve

@dbasunag

Copy link
Copy Markdown
Contributor

/verified

@myakove myakove merged commit cfbe441 into RedHatQE:main Sep 16, 2025
7 checks passed
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.

7 participants