Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #2636 to release/v1.7 for Bugfix ingress route settings #2642

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

vdaas-ci
Copy link
Collaborator

@vdaas-ci vdaas-ci commented Sep 24, 2024

Description

Fixed a problem with proper routing if the PATH setting was not made correctly.

The following are generated ingress manifest

when lb are enabled
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/grpc-backend: "true"
  labels:
    name: vald-lb-gateway-ingress
    app: vald-lb-gateway-ingress
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.7.13
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: vald
    app.kubernetes.io/version: v1.7.13
    app.kubernetes.io/component: gateway-lb
  name: vald-ingress
spec:
  defaultBackend:
    service:
      name: vald-lb-gateway
      port:
        name: grpc
  rules:
  - host: lb.gateway.vald.vdaas.org
    http:
      paths:
      - path: "/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1.ServerReflection/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
when mirror and lb are enabled
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/grpc-backend: "true"
  labels:
    name: vald-mirror-gateway-ingress
    app: vald-mirror-gateway-ingress
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.7.13
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: vald
    app.kubernetes.io/version: v1.7.13
    app.kubernetes.io/component: gateway-mirror
  name: vald-ingress
spec:
  defaultBackend:
    service:
      name: vald-mirror-gateway
      port:
        name: grpc
  rules:
  - host: mirror.gateway.vald.vdaas.org
    http:
      paths:
      - path: "/vald.v1.Search/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Insert/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Update/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      # NOTE: Change backend service to mirror after UpdateTimestamp is implemented in mirror.
      - path: "/vald.v1.Update/UpdateTimestamp"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Upsert/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Remove/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Index/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      # NOTE: Change backend service to mirror after Flush is implemented in mirror.
      - path: "/vald.v1.Flush/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/mirror.v1.Mirror/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1.ServerReflection/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
when mirror and lb and filter are enabled
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/grpc-backend: "true"
  labels:
    name: vald-filter-gateway-ingress
    app: vald-filter-gateway-ingress
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.7.13
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: vald
    app.kubernetes.io/version: v1.7.13
    app.kubernetes.io/component: gateway-filter
  name: vald-ingress
spec:
  defaultBackend:
    service:
      name: vald-filter-gateway
      port:
        name: grpc
  rules:
  - host: filter.gateway.vald.vdaas.org
    http:
      paths:
      - path: "/vald.v1.Search/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Insert/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Update/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      # NOTE: Change backend service to mirror after UpdateTimestamp is implemented in mirror.
      - path: "/vald.v1.Update/UpdateTimestamp"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Upsert/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Remove/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/Exists/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/GetTimestamp/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Index/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      # NOTE: Change backend service to mirror after Flush is implemented in mirror.
      - path: "/vald.v1.Flush/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/mirror.v1.Mirror/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Filter/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1.ServerReflection/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
when filter and lb are enabled
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/grpc-backend: "true"
  labels:
    name: vald-filter-gateway-ingress
    app: vald-filter-gateway-ingress
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.7.13
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: vald
    app.kubernetes.io/version: v1.7.13
    app.kubernetes.io/component: gateway-filter
  name: vald-ingress
spec:
  defaultBackend:
    service:
      name: vald-filter-gateway
      port:
        name: grpc
  rules:
  - host: filter.gateway.vald.vdaas.org
    http:
      paths:
      - path: "/vald.v1.Search/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Insert/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Update/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Upsert/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Remove/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Index/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/Exists/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/GetTimestamp/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Flush/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Filter/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1.ServerReflection/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific

Related Issue

Versions

  • Vald Version: v1.7.13
  • Go Version: v1.23.1
  • Rust Version: v1.81.0
  • Docker Version: v27.2.1
  • Kubernetes Version: v1.31.0
  • Helm Version: v3.16.0
  • NGT Version: v2.2.4
  • Faiss Version: v1.8.0

Checklist

Special notes for your reviewer

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Added reflection support for gRPC services, enhancing service discovery.
    • Introduced new paths for gRPC reflection services to ensure correct routing.
  • Improvements

    • Updated existing paths to include trailing slashes for better routing consistency.
    • Enhanced ingress routing logic for more granular control based on service conditions.

* feat: correct ingress route

Signed-off-by: hlts2 <[email protected]>

* fix: helm template parse error

Signed-off-by: hlts2 <[email protected]>

* fix: bugfix ingress route for filter

Signed-off-by: hlts2 <[email protected]>

* fix: route order

Signed-off-by: hlts2 <[email protected]>

* fix: updatetimestamp route

Signed-off-by: hlts2 <[email protected]>

* fix: route settings

Signed-off-by: hlts2 <[email protected]>

* fix: server reflection path

Signed-off-by: hlts2 <[email protected]>

* fix: server reflection handling

Signed-off-by: hlts2 <[email protected]>

* fix: tweak

Signed-off-by: hlts2 <[email protected]>

* fix: deleted unnecessary variable

Signed-off-by: hlts2 <[email protected]>

---------

Signed-off-by: hlts2 <[email protected]>
Co-authored-by: Yusuke Kato <[email protected]>
Copy link

cloudflare-workers-and-pages bot commented Sep 24, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: f023003
Status: ✅  Deploy successful!
Preview URL: https://84fe25c8.vald.pages.dev
Branch Preview URL: https://backport-release-v1-7-fix-mi-pp9g.vald.pages.dev

View logs

Copy link
Contributor

coderabbitai bot commented Sep 24, 2024

Walkthrough

Walkthrough

The changes in this pull request focus on the ing.yaml file, enhancing the configuration for gateway services. Key modifications include the introduction of reflection-related settings for filters and load balancers, updates to gRPC method paths to include trailing slashes, and adjustments to backend service assignments based on new routing logic. New paths for gRPC reflection services have also been added to ensure proper request handling.

Changes

Files Change Summary
charts/vald/templates/gateway/ing.yaml - Added variables for reflection settings: reflectionEnabled, filterReflectionEnabled, lbReflectionEnabled.
- Updated gRPC method paths to include trailing slashes.
- Modified backend service assignments for Update, Remove, Flush, and other paths to reflect new routing logic.
- Introduced new paths for gRPC reflection services.

Possibly related PRs

  • Bugfix ingress route settings #2636: This PR modifies the same ing.yaml file and includes changes to the paths for gRPC methods, specifically adding trailing slashes and adjusting backend service assignments, which directly relates to the routing logic enhancements in the main PR.

Suggested labels

priority/low, area/helm, area/gateway/lb, area/gateway/filter, area/gateway/mirror, area/filter/ingress, size/S

Suggested reviewers

  • hlts2

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Outside diff range and nitpick comments (1)
charts/vald/templates/gateway/ing.yaml (1)

216-279: LGTM: Consistent routing configuration for mirror and LB

The routing configuration for the scenario where mirror and LB are enabled has been updated consistently with the previous segments. The changes provide more specific routing based on the enabled components, which aligns well with the PR objectives.

Points to note:

  1. The use of trailing slashes in paths remains consistent, maintaining a uniform routing pattern across different scenarios.

  2. There are still TODO comments indicating future changes (e.g., lines 229-230 and 266-267). It would be beneficial to create follow-up tasks to implement these changes.

Would you like me to create GitHub issues to track the implementation of the features mentioned in the TODO comments?

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5bbb78a and f023003.

Files selected for processing (1)
  • charts/vald/templates/gateway/ing.yaml (2 hunks)
Additional context used
yamllint
charts/vald/templates/gateway/ing.yaml

[error] 16-16: syntax error: expected the node content, but found '-'

(syntax)

Additional comments not posted (6)
charts/vald/templates/gateway/ing.yaml (6)

16-24: LGTM: Enhanced gRPC reflection control

The introduction of reflectionEnabled, filterReflectionEnabled, and lbReflectionEnabled variables provides more granular control over gRPC reflection settings for different gateway components. This change aligns well with the PR objective of enhancing routing capabilities and fixing ingress settings.

Tools
yamllint

[error] 16-16: syntax error: expected the node content, but found '-'

(syntax)


149-215: LGTM: Consistent routing configuration for filter and LB

The routing configuration for the scenario where filter and LB are enabled has been updated consistently with the previous segment. The changes provide more specific routing based on the enabled components, which aligns well with the PR objectives.

The use of trailing slashes in paths remains consistent, which is good for maintaining a uniform routing pattern across different scenarios.


280-285: LGTM: Simplified routing for LB-only configuration

The routing configuration for the scenario where only LB is enabled has been simplified to route all traffic to the LB service. This straightforward approach aligns well with the PR objectives for this specific scenario.


287-315: LGTM: Enhanced gRPC reflection routing

The addition of gRPC reflection routes is a valuable enhancement to the system. These routes are conditionally added based on the reflection settings of the filter and LB components, ensuring that reflection is only enabled for the appropriate services.

This change aligns well with the PR objectives of enhancing routing capabilities and provides better support for gRPC clients that rely on server reflection.


16-16: False positive: Syntax is correct for Helm templates

The static analysis tool reported a syntax error on this line, but this is a false positive. The syntax {{- $reflectionEnabled := .Values.defaults.server_config.servers.grpc.server.grpc.enable_reflection -}} is correct for Helm template variable declaration.

Static analysis tools sometimes struggle with template languages like Helm's. In this case, the syntax is valid and doesn't require any changes.

Tools
yamllint

[error] 16-16: syntax error: expected the node content, but found '-'

(syntax)


Line range hint 1-315: Overall: Significant improvements to gateway routing and reflection settings

This PR introduces substantial enhancements to the Vald gateway's Ingress configuration:

  1. More granular control over gRPC reflection settings with new variables.
  2. Improved routing configurations for various scenarios (mirror, filter, and LB combinations).
  3. Consistent use of trailing slashes in paths across different routing configurations.
  4. Addition of gRPC reflection routes with conditional enabling.

These changes align well with the PR objectives of enhancing routing capabilities and fixing ingress settings. The modifications provide better flexibility and control over the gateway's behavior in different scenarios.

Suggestions for follow-up:

  1. Address the TODOs and comments indicating future changes (e.g., UpdateTimestamp and Flush implementations in mirror).
  2. Consider creating a task to review and validate the trailing slash usage in paths to ensure it meets the intended API design.

Overall, these changes significantly improve the gateway's routing capabilities and reflect a thoughtful approach to handling various deployment scenarios.

Comment on lines +68 to +148
{{- if and $mirrorIngEnabled $filterIngEnabled $lb.enabled }}
- path: "/vald.v1.Search/"
backend:
service:
name: {{ $filter.name }}
{{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }}
pathType: {{ $filter.ingress.pathType }}
- path: "/vald.v1.Insert"
- path: "/vald.v1.Insert/"
backend:
service:
name: {{ $filter.name }}
{{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }}
pathType: {{ $filter.ingress.pathType }}
- path: "/vald.v1.Update"
# NOTE: Change backend service to mirror after UpdateTimestamp is implemented in mirror.
- path: "/vald.v1.Update/UpdateTimestamp"
backend:
service:
name: {{ $lb.name }}
{{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }}
pathType: {{ $lb.ingress.pathType }}
- path: "/vald.v1.Update/"
backend:
service:
name: {{ $filter.name }}
{{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }}
pathType: {{ $filter.ingress.pathType }}
- path: "/vald.v1.Upsert"
- path: "/vald.v1.Upsert/"
backend:
service:
name: {{ $filter.name }}
{{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }}
pathType: {{ $filter.ingress.pathType }}
- path: "/vald.v1.Index"
- path: "/vald.v1.Remove/"
backend:
service:
name: {{ $mirror.name }}
{{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }}
pathType: {{ $mirror.ingress.pathType }}
- path: "/vald.v1.Object/Exists"
backend:
service:
name: {{ $lb.name }}
{{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }}
pathType: {{ $lb.ingress.pathType }}
- path: "/vald.v1.Object.Exists"
- path: "/vald.v1.Object/GetTimestamp"
backend:
service:
name: {{ $lb.name }}
{{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }}
pathType: {{ $lb.ingress.pathType }}
- path: "/vald.v1.Object.GetTimestamp"
- path: "/vald.v1.Object/"
backend:
service:
name: {{ $filter.name }}
{{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }}
pathType: {{ $filter.ingress.pathType }}
- path: "/vald.v1.Index/"
backend:
service:
name: {{ $lb.name }}
{{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }}
pathType: {{ $lb.ingress.pathType }}
- path: "/vald.v1.Object"
# NOTE: Change backend service to mirror after Flush is implemented in mirror.
- path: "/vald.v1.Flush/"
backend:
service:
name: {{ $filter.name }}
name: {{ $lb.name }}
{{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 12 }}
pathType: {{ $filter.ingress.pathType }}
- backend:
pathType: {{ $lb.ingress.pathType }}
- path: "/mirror.v1.Mirror/Register"
backend:
service:
name: {{ $mirror.name }}
{{- include "vald.ingressPort" (dict "Values" $mirror.ingress) | nindent 12 }}
pathType: {{ $mirror.ingress.pathType }}
- path: "/vald.v1.Filter/"
backend:
service:
name: {{ $filter.name }}
{{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 12 }}
pathType: {{ $filter.ingress.pathType }}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Action Required: Inconsistent Use of Trailing Slashes in Paths

The analysis of the routing configuration reveals inconsistencies in the use of trailing slashes in path definitions. This may lead to unexpected routing behaviors and should be standardized to align with your API design.

Affected Lines:

  • Lines with trailing slashes:

    • /vald.v1.Search/ (Lines: 69, 150, 217)
    • /vald.v1.Insert/ (Lines: 75, 156, 223)
    • /vald.v1.Update/ (Lines: 88, 162, 236)
    • /vald.v1.Upsert/ (Lines: 94, 168, 242)
    • /vald.v1.Remove/ (Lines: 100, 174, 248)
    • /vald.v1.Index/ (Lines: 124, 180, 260)
    • /vald.v1.Flush/ (Lines: 131, 267, 273)
    • /vald.v1.Filter/ (Lines: 143, 210, 280)
  • Paths without trailing slashes:

    • /vald.v1.Update/UpdateTimestamp (Lines: 82, 230)
    • /vald.v1.Object/Exists (Lines: 106, 186)
    • /vald.v1.Object/GetTimestamp (Lines: 112, 192)
    • /vald.v1.Object/ (Lines: 118, 198, 254)
    • /mirror.v1.Mirror/Register (Lines: 137, 273)
    • /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo (Line: 288)
    • /grpc.reflection.v1.ServerReflection/ServerReflectionInfo (Line: 302)
    • / (Line: 280)

Recommendations:

  1. Standardize Trailing Slashes: Decide whether to include or omit trailing slashes in all path definitions to ensure consistent routing behavior.
  2. Update Affected Paths: Modify the paths to adhere to the chosen standard across all affected lines.
  3. Review Routing Logic: Ensure that the routing logic correctly interprets the standardized paths to prevent any mismatches or routing issues.
Analysis chain

LGTM: Improved routing configuration

The routing configuration has been significantly enhanced to provide more specific routing based on the enabled components (mirror, filter, and LB). This aligns well with the PR objectives.

However, there are a couple of points to consider:

  1. Some routes are marked for future changes (e.g., lines 81-82 and 130-131). It would be beneficial to create follow-up tasks to implement these changes.

  2. The use of trailing slashes in paths (e.g., "/vald.v1.Search/") might affect routing behavior. Ensure that this is the intended configuration and is consistent with your API design.

To verify the consistency of trailing slashes in paths, you can run the following command:

This will list all path definitions, allowing you to review the consistency of trailing slash usage.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for consistency in the use of trailing slashes in paths
grep -n 'path:' charts/vald/templates/gateway/ing.yaml | sed 's/^ *//g'

Length of output: 1587

@vdaas-ci
Copy link
Collaborator Author

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

@kpango kpango merged commit 85c1bea into release/v1.7 Sep 24, 2024
39 of 40 checks passed
@kpango kpango deleted the backport/release/v1.7/fix/mirror/ingress branch September 24, 2024 09:37
@kpango kpango mentioned this pull request Oct 11, 2024
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.

3 participants