Skip to content

Conversation

@zetxqx
Copy link
Contributor

@zetxqx zetxqx commented Dec 8, 2025

What type of PR is this?

/kind bug
/kind cleanup

What this PR does / why we need it:

This fixes an issue where the controller manager would fail to start if the InferenceModelRewrite or InferenceObjective CRDs were missing. This change introduces a dynamic check for the existence of these CRDs before attempting to set up reconcilers or adding them to the cache. This allows the controller to gracefully handle environments where these optional CRDs are not installed, even when CRD reconciliation is generally enabled.

Tested with deleting the inferenceModelRewrites CRD and start the EPP successfully.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

Make InferenceModelRewrite and InferenceObjective optional to install

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Dec 8, 2025
@netlify
Copy link

netlify bot commented Dec 8, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit 1c13110
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/69370f3d04e62300085cbef6
😎 Deploy Preview https://deploy-preview-1967--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: zetxqx
Once this PR has been reviewed and has the lgtm label, please assign ahg-g for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 8, 2025
…enceObjective when disableK8sCrdReconcile is true

This fixes an issue where the controller manager would fail to start if the InferenceModelRewrite or InferenceObjective CRDs were missing.
This change introduces a dynamic check for the existence of these CRDs before attempting to set up reconcilers or adding them to the cache. This allows the controller to gracefully handle environments where these optional CRDs are not installed, even when CRD reconciliation is generally enabled.

Refactoring:
- Moved kindExists to pkg/epp/server/controller_manager.go
- Updated kindExists signature to accept discovery.DiscoveryInterface
- Reused discovery client in NewDefaultManager and ExtProcServerRunner.SetupWithManager to avoid repeated client creation overhead.

Done by: gemini-cli
TEST=go test ./pkg/epp/server/... passed
@zetxqx
Copy link
Contributor Author

zetxqx commented Dec 8, 2025

/cc @kfswain @ahg-g

This is another inferenceModelRewrites hardening PR. This will let both inferenceModelRewrites and InferenceObjective be optional for EPP startup. In case someone missing install those CRDs and not planning to use them. Revealed in #1936

I tested this working well by deleting the infrenceModelRewrites CRD in my cluster and start the EPP with my custom image including this PR. And the EPP can start successfully.

@k8s-ci-robot k8s-ci-robot requested a review from ahg-g December 8, 2025 18:55
@zetxqx zetxqx changed the title fix(epp): conditionally skip watching InferenceModelRewrite and InferenceObjective fix(inferenceModelRewrites): conditionally skip watching InferenceModelRewrite and InferenceObjective Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants