Skip to content

[bugfix] fix ingress annotation reconciliation#144

Merged
slin1237 merged 1 commit intomainfrom
slin/ingress-annotation-bug
Jul 7, 2025
Merged

[bugfix] fix ingress annotation reconciliation#144
slin1237 merged 1 commit intomainfrom
slin/ingress-annotation-bug

Conversation

@slin1237
Copy link
Collaborator

@slin1237 slin1237 commented Jul 7, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

This PR fixes a bug where the DisableIngressCreation annotation override was not working at the InferenceService level. Previously, the annotation
ome.io/ingress-disable-creation: "true" set on an individual InferenceService was being ignored, and only the cluster-wide configuration in the
ConfigMap was being respected.

The issue was that both the ingress reconciler and external service reconciler were checking the base configuration's DisableIngressCreation flag
before resolving the configuration with annotation overrides.

The fix consolidates the configuration resolution in the main controller, ensuring that:

  1. The ingress configuration is resolved once with annotation overrides in controller.go
  2. The resolved configuration is passed to both the ingress and external service reconcilers
  3. Both reconcilers now properly respect per-InferenceService annotation overrides

Which 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 reconcilers
  • The ingress and external service reconcilers continue to work with the configuration passed to them, ensuring consistent behavior

This 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?

Fixed annotation override for DisableIngressCreation - the annotation `ome.io/ingress-disable-creation: "true"` now properly disables ingress
creation at the InferenceService level, allowing users to override the cluster-wide configuration on a per-service basis.

@github-actions github-actions bot added the bug Something isn't working label Jul 7, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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 DisableIngressCreation annotation on individual InferenceService objects 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Comment on lines +430 to 434
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")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The setExternalServiceURL function hardcodes the URL scheme to http. It should use the UrlScheme from the resolvedIngressConfig to respect the ome.io/ingress-url-scheme annotation.[^1]

@slin1237 slin1237 merged commit 3b8e0da into main Jul 7, 2025
24 checks passed
@slin1237 slin1237 deleted the slin/ingress-annotation-bug branch July 7, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants