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

Add ability to specify top-level backendRefs #93

Open
pehala opened this issue Jun 24, 2024 · 0 comments
Open

Add ability to specify top-level backendRefs #93

pehala opened this issue Jun 24, 2024 · 0 comments
Labels
enhancement New feature or request kind/enhancement

Comments

@pehala
Copy link

pehala commented Jun 24, 2024

Based on https://docs.kuadrant.io/0.7.0/kuadrantctl/doc/openapi-kuadrant-extensions/, backendRefs need to specified in either path or operation, this makes it cumbersome to use in APIs that have a lot of paths but only one backend, since you need to copy the same backendRefs to every path.

I propose adding top-level backendRefs to the route to remove repetition to act as a default, if path/operation do not specify any backend.

Example:

openapi: "3.1.0"
info:
  title: "Pet Store API"
  version: "1.0.0"
  x-kuadrant:
    route:
      name: "petstore"
      namespace: "petstore"
      hostnames:
        - example.com
      parentRefs:
        - name: istio-ingressgateway
          namespace: istio-system
      backendRefs:
        - name: petstore
          port: 80
          namespace: petstore
servers:
  - url: https://example.io/api/v1
paths:
  /cat:
    get:
      operationId: "getCat"
      responses:
        405:
          description: "invalid input"
    post:  # API key
      operationId: "postCat"
      responses:
        405:
          description: "invalid input"
  /dog:
    x-kuadrant:
      backendRefs:
        - name: dogstore
          port: 80
          namespace: dogstore
    get:  # OIDC
      operationId: "getDog"
      responses:
        405:
          description: "invalid input"
@pehala pehala added enhancement New feature or request kind/enhancement labels Jun 24, 2024
@pehala pehala added this to Kuadrant Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request kind/enhancement
Projects
Status: No status
Development

No branches or pull requests

1 participant