[bugfix] fix ingress annotation reconciliation#144
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @slin1237, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses a bug where the DisableIngressCreation annotation on InferenceService objects was not being properly reconciled. The fix centralizes the resolution of ingress configuration, ensuring that per-service annotation overrides are correctly applied and respected by all relevant reconcilers.
Highlights
- Bug Fix: Annotation Override: The
DisableIngressCreationannotation on individualInferenceServiceobjects was previously ignored, causing ingress resources to be created even when explicitly disabled. This PR rectifies this by ensuring per-InferenceService annotation overrides are correctly applied. - Centralized Configuration Resolution: The ingress configuration, including any annotation overrides, is now resolved once within the main controller (
controller.go). This resolved configuration is then consistently passed to both the ingress and external service reconcilers, ensuring all components respect the per-service overrides.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Code Review
This pull request fixes a bug where the DisableIngressCreation annotation override was not working at the InferenceService level. The configuration resolution is now consolidated in the main controller, ensuring that per-InferenceService annotations are properly respected.
| if resolvedIngressConfig.DisableIngressCreation { | ||
| if err := r.setExternalServiceURL(ctx, isvc, resolvedIngressConfig); err != nil { | ||
| r.Recorder.Event(isvc, v1.EventTypeWarning, "InternalError", err.Error()) | ||
| return reconcile.Result{}, errors.Wrapf(err, "fails to set external service URL") | ||
| } |
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR fixes a bug where the
DisableIngressCreationannotation override was not working at the InferenceService level. Previously, the annotationome.io/ingress-disable-creation: "true"set on an individual InferenceService was being ignored, and only the cluster-wide configuration in theConfigMap was being respected.
The issue was that both the ingress reconciler and external service reconciler were checking the base configuration's
DisableIngressCreationflagbefore resolving the configuration with annotation overrides.
The fix consolidates the configuration resolution in the main controller, ensuring that:
controller.goWhich issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
The key changes are in:
pkg/controller/v1beta1/inferenceservice/controller.go: Now resolves the ingress config with annotations once and passes it to both reconcilersThis change ensures that users can disable ingress creation for specific InferenceServices without affecting the cluster-wide default behavior.
Does this PR introduce a user-facing change?